diff options
author | James Brown | 2004-01-16 10:45:56 +0000 |
---|---|---|
committer | James Brown | 2004-01-16 10:45:56 +0000 |
commit | ac5b7036c28a4137d4b7af7385d97e6e485f0767 (patch) | |
tree | b9453259912d5f2c462d8107280ef83303e5fd14 /scumm/actor.cpp | |
parent | bd3f51dfdfd563532a7cc228139dd60d8f6451a4 (diff) | |
download | scummvm-rg350-ac5b7036c28a4137d4b7af7385d97e6e485f0767.tar.gz scummvm-rg350-ac5b7036c28a4137d4b7af7385d97e6e485f0767.tar.bz2 scummvm-rg350-ac5b7036c28a4137d4b7af7385d97e6e485f0767.zip |
Fix for bug #862263 - Maniac actors never stop talking. I know this could probably be neater :)
svn-id: r12430
Diffstat (limited to 'scumm/actor.cpp')
-rw-r--r-- | scumm/actor.cpp | 32 |
1 files changed, 24 insertions, 8 deletions
diff --git a/scumm/actor.cpp b/scumm/actor.cpp index b2b5b2cf28..7018c980b8 100644 --- a/scumm/actor.cpp +++ b/scumm/actor.cpp @@ -561,7 +561,7 @@ void Actor::setDirection(int direction) { } void Actor::putActor(int dstX, int dstY, byte newRoom) { - if (visible && _vm->_currentRoom != newRoom && _vm->VAR(_vm->VAR_TALK_ACTOR) == number) { + if (visible && _vm->_currentRoom != newRoom && _vm->talkingActor() == number) { _vm->clearMsgQueue(); } @@ -781,6 +781,22 @@ void Actor::showActor() { needRedraw = true; } +// Maniac doesn't have a ScummVar for VAR_TALK_ACTOR, and just uses +// an internal variable. Emulate this to prevent overwriting script vars... +int ScummEngine::talkingActor() { + if (_gameId == GID_MANIAC) + return _V1_talkingActor; + else + return VAR(VAR_TALK_ACTOR); +}; + +void ScummEngine::talkingActor(int value) { + if (_gameId == GID_MANIAC) + _V1_talkingActor = value; + else + VAR(VAR_TALK_ACTOR) = value; +}; + void ScummEngine::showActors() { int i; @@ -1138,7 +1154,7 @@ void ScummEngine::actorTalk() { if (_actorToPrintStrFor == 0xFF) { if (!_keepText) stopTalk(); - VAR(VAR_TALK_ACTOR) = 0xFF; + talkingActor(0xFF); } else { int oldact; @@ -1154,21 +1170,21 @@ void ScummEngine::actorTalk() { } else { if (!_keepText) stopTalk(); - VAR(VAR_TALK_ACTOR) = a->number; + talkingActor(a->number); if (!_string[0].no_talk_anim) { a->startAnimActor(a->talkStartFrame); _useTalkAnims = true; } - oldact = VAR(VAR_TALK_ACTOR); + oldact = talkingActor(); } if (oldact >= 0x80) return; } - if (((_gameId == GID_MANIAC) && (_version == 1)) || VAR(VAR_TALK_ACTOR) > 0x7F) { + if (((_gameId == GID_MANIAC) && (_version == 1)) || talkingActor() > 0x7F) { _charsetColor = (byte)_string[0].color; } else { - a = derefActor(VAR(VAR_TALK_ACTOR), "actorTalk(2)"); + a = derefActor(talkingActor(), "actorTalk(2)"); _charsetColor = a->talkColor; } _charsetBufPos = 0; @@ -1188,14 +1204,14 @@ void ScummEngine::stopTalk() { _haveMsg = 0; _talkDelay = 0; - act = VAR(VAR_TALK_ACTOR); + act = talkingActor(); if (act && act < 0x80) { Actor *a = derefActor(act, "stopTalk"); if ((a->isInCurrentRoom() && _useTalkAnims) || (_features & GF_NEW_COSTUMES)) { a->startAnimActor(a->talkStopFrame); _useTalkAnims = false; } - VAR(VAR_TALK_ACTOR) = 0xFF; + talkingActor(0xFF); } _keepText = false; _charset->restoreCharsetBg(); |