From 8cbdf0e6295fd31b2a355fdb4c7bdc84176c1b48 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Tue, 16 Aug 2005 13:13:27 +0000 Subject: o Fix crashes on puzzle with floppy (speechless) versions o Now hints get correct voices. svn-id: r18695 --- saga/actor.cpp | 5 ++++- saga/puzzle.cpp | 8 ++++---- 2 files changed, 8 insertions(+), 5 deletions(-) (limited to 'saga') diff --git a/saga/actor.cpp b/saga/actor.cpp index f35bf149b8..3ac6e62360 100644 --- a/saga/actor.cpp +++ b/saga/actor.cpp @@ -2052,7 +2052,10 @@ void Actor::nonActorSpeech(const Common::Rect &box, const char **strings, int st _activeSpeech.speechFlags = speechFlags; _activeSpeech.actorsCount = 1; _activeSpeech.actorIds[0] = 0; - _activeSpeech.sampleResourceId = sampleResourceId; + if (!(_vm->getFeatures() & GF_CD_FX)) + _activeSpeech.sampleResourceId = -1; + else + _activeSpeech.sampleResourceId = sampleResourceId; _activeSpeech.playing = false; _activeSpeech.slowModeCharIndex = 0; _activeSpeech.speechBox = box; diff --git a/saga/puzzle.cpp b/saga/puzzle.cpp index 26ef8ca518..9c76c61297 100644 --- a/saga/puzzle.cpp +++ b/saga/puzzle.cpp @@ -608,11 +608,11 @@ void Puzzle::giveHint(void) { } if (i >= 0) { - char hintBuf[64]; - const char *hintPtr = hintBuf; - sprintf(hintBuf, optionsStr[_lang][kROHint], pieceNames[piece]); + static char hintBuf[64]; + static const char *hintPtr = hintBuf; + sprintf(hintBuf, optionsStr[_lang][kROHint], pieceNames[_lang][piece]); - _vm->_actor->nonActorSpeech(_hintBox, &hintPtr, 1, PUZZLE_TOOL_SOUNDS + _hintSpeaker + piece, 0); + _vm->_actor->nonActorSpeech(_hintBox, &hintPtr, 1, PUZZLE_TOOL_SOUNDS + _hintSpeaker + piece * 3, 0); } else { // If no pieces are in the wrong place -- cgit v1.2.3