[Scummvm-cvs-logs] SF.net SVN: scummvm:[42676] scummvm/trunk/engines/lure/hotspots.cpp
dreammaster at users.sourceforge.net
dreammaster at users.sourceforge.net
Thu Jul 23 12:49:31 CEST 2009
Revision: 42676
http://scummvm.svn.sourceforge.net/scummvm/?rev=42676&view=rev
Author: dreammaster
Date: 2009-07-23 10:49:30 +0000 (Thu, 23 Jul 2009)
Log Message:
-----------
Bugfix for player blocking room entrance causing NPCs trying to enter getting an excessive number of action entries
Modified Paths:
--------------
scummvm/trunk/engines/lure/hotspots.cpp
Modified: scummvm/trunk/engines/lure/hotspots.cpp
===================================================================
--- scummvm/trunk/engines/lure/hotspots.cpp 2009-07-23 10:33:13 UTC (rev 42675)
+++ scummvm/trunk/engines/lure/hotspots.cpp 2009-07-23 10:49:30 UTC (rev 42676)
@@ -2691,7 +2691,19 @@
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");
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list