diff options
author | Paul Gilbert | 2006-09-03 08:39:06 +0000 |
---|---|---|
committer | Paul Gilbert | 2006-09-03 08:39:06 +0000 |
commit | 92f2e9691edf0b7466841b8f7c99f2e50eb7feda (patch) | |
tree | f313d6d1f78fd12375622a2efd050597776a89da /engines/lure/hotspots.cpp | |
parent | 816cc1a62c3e0a48d50c77a92538b4ada4783fe1 (diff) | |
download | scummvm-rg350-92f2e9691edf0b7466841b8f7c99f2e50eb7feda.tar.gz scummvm-rg350-92f2e9691edf0b7466841b8f7c99f2e50eb7feda.tar.bz2 scummvm-rg350-92f2e9691edf0b7466841b8f7c99f2e50eb7feda.zip |
Fixed handling of player occupied areas during room changes
svn-id: r23826
Diffstat (limited to 'engines/lure/hotspots.cpp')
-rw-r--r-- | engines/lure/hotspots.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/engines/lure/hotspots.cpp b/engines/lure/hotspots.cpp index 63c8b5b953..5fa8f46ac8 100644 --- a/engines/lure/hotspots.cpp +++ b/engines/lure/hotspots.cpp @@ -2146,9 +2146,10 @@ void HotspotTickHandlers::standardCharacterAnimHandler(Hotspot &h) { // Walking done h.currentActions().top().setAction(DISPATCH_ACTION); - if (h.destHotspotId() != 0) + if (h.destHotspotId() != 0) { // Walking to an exit, check for any required room change Support::checkRoomChange(h); + } } h.setOccupied(true); @@ -2448,7 +2449,9 @@ void HotspotTickHandlers::playerAnimHandler(Hotspot &h) { } // Check for whether need to change room - Support::checkRoomChange(h); + if (Support::checkRoomChange(h)) + // Player changinge room - break now to avoid resetting occupied status + break; } h.setOccupied(true); break; @@ -3461,7 +3464,7 @@ bool Support::checkForIntersectingCharacter(Hotspot &h) { // Check whether a character needs to change the room they're in -void Support::checkRoomChange(Hotspot &h) { +bool Support::checkRoomChange(Hotspot &h) { int16 x = h.x() + (h.widthCopy() >> 1); int16 y = h.y() + h.heightCopy() - (h.yCorrection() >> 1); @@ -3476,6 +3479,8 @@ void Support::checkRoomChange(Hotspot &h) { exitRec->x, exitRec->y, exitRec->direction); } } + + return (exitRec != NULL); } void Support::characterChangeRoom(Hotspot &h, uint16 roomNumber, |