diff options
author | Paul Gilbert | 2006-11-12 04:42:37 +0000 |
---|---|---|
committer | Paul Gilbert | 2006-11-12 04:42:37 +0000 |
commit | b648aaf64b167ad9fe290b7ee632afee3ca4f5d4 (patch) | |
tree | 502943d4508f93d80fad7fe4bfd9c87f57ffef46 | |
parent | 0a5b86736cc0ab55ec3fa39394a5e4069ddcfa01 (diff) | |
download | scummvm-rg350-b648aaf64b167ad9fe290b7ee632afee3ca4f5d4.tar.gz scummvm-rg350-b648aaf64b167ad9fe290b7ee632afee3ca4f5d4.tar.bz2 scummvm-rg350-b648aaf64b167ad9fe290b7ee632afee3ca4f5d4.zip |
Bugfix to prevent player freezing in place after bumping into another character
svn-id: r24688
-rw-r--r-- | engines/lure/res_struct.cpp | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/engines/lure/res_struct.cpp b/engines/lure/res_struct.cpp index 28cbabd0c9..a5c4bc45e0 100644 --- a/engines/lure/res_struct.cpp +++ b/engines/lure/res_struct.cpp @@ -798,7 +798,7 @@ PausedCharacter::PausedCharacter(uint16 SrcCharId, uint16 DestCharId) { srcCharId = SrcCharId; destCharId = DestCharId; counter = IDLE_COUNTDOWN_SIZE; - charHotspot = Resources::getReference().getHotspot(SrcCharId); + charHotspot = Resources::getReference().getHotspot(DestCharId); assert(charHotspot); } @@ -868,19 +868,22 @@ int PausedCharacterList::check(uint16 charId, int numImpinging, uint16 *impingin // Scan through the pause list to see if there's a record for the // calling character and the impinging list entry - for (i = res.pausedList().begin(); i != res.pausedList().end(); ++i) { + bool foundEntry = false; + for (i = res.pausedList().begin(); !foundEntry && (i != res.pausedList().end()); ++i) { PausedCharacter *rec = *i; - if ((rec->srcCharId == charId) && - (rec->destCharId == hotspot->hotspotId())) - break; + foundEntry = (rec->srcCharId == charId) && + (rec->destCharId == hotspot->hotspotId()); } - if (i != res.pausedList().end()) + if (foundEntry) // There was, so move to next impinging character entry continue; if ((hotspot->hotspotId() == PLAYER_ID) && !hotspot->coveredFlag()) + { + hotspot->updateMovement(); return 1; + } // Add a new paused character entry PausedCharacter *entry = new PausedCharacter(charId, hotspot->hotspotId()); @@ -892,9 +895,9 @@ int PausedCharacterList::check(uint16 charId, int numImpinging, uint16 *impingin ((charHotspot->pauseCtr() == 0) && (charHotspot->characterMode() == CHARMODE_NONE))) { hotspot->resource()->use2HotspotId = charId; - } else { - hotspot->setPauseCtr(IDLE_COUNTDOWN_SIZE); } + + hotspot->setPauseCtr(IDLE_COUNTDOWN_SIZE); } result = 2; |