mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-13 21:31:53 +00:00
Bugfix for player blocking room entrance causing NPCs trying to enter getting an excessive number of action entries
svn-id: r42676
This commit is contained in:
parent
c8d7b677f8
commit
53783575d8
@ -2691,7 +2691,19 @@ void HotspotTickHandlers::standardCharacterAnimHandler(Hotspot &h) {
|
||||
return;
|
||||
}
|
||||
h.currentActions().top().setAction(WALKING);
|
||||
h.setPosition(h.x(), h.y() & 0xfff8);
|
||||
|
||||
// WORKAROUND: A character that had enteredg an exit area might have been blocked from entering the new room.
|
||||
// The Y position adjust below could thus place a character further into the exit area. So don't do the
|
||||
// position adjustment if the user is already in an exit area
|
||||
int16 x = h.x() + (h.widthCopy() >> 1);
|
||||
int16 y = h.y() + h.heightCopy() - (h.yCorrection() >> 1);
|
||||
|
||||
RoomData *roomData = Resources::getReference().getRoom(h.roomNumber());
|
||||
RoomExitData *exitRec = roomData->exits.checkExits(x, y);
|
||||
|
||||
if (!exitRec)
|
||||
h.setPosition(h.x(), h.y() & 0xfff8);
|
||||
|
||||
} else if (h.blockedState() == BS_FINAL) {
|
||||
// If this point is reached, the character twice hasn't found a walking path
|
||||
debugC(ERROR_DETAILED, kLureDebugAnimations, "Character is hopelessly blocked");
|
||||
|
Loading…
Reference in New Issue
Block a user