o Fix crashes on puzzle with floppy (speechless) versions

o Now hints get correct voices.

svn-id: r18695
This commit is contained in:
Eugene Sandulenko 2005-08-16 13:13:27 +00:00
parent 0db33e8dfd
commit 8cbdf0e629
2 changed files with 8 additions and 5 deletions

View File

@ -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;

View File

@ -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