From b648aaf64b167ad9fe290b7ee632afee3ca4f5d4 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 12 Nov 2006 04:42:37 +0000 Subject: [PATCH] Bugfix to prevent player freezing in place after bumping into another character svn-id: r24688 --- engines/lure/res_struct.cpp | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/engines/lure/res_struct.cpp b/engines/lure/res_struct.cpp index 28cbabd0c94..a5c4bc45e0d 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;