[Scummvm-cvs-logs] SF.net SVN: scummvm: [23826] scummvm/trunk/engines/lure

dreammaster at users.sourceforge.net dreammaster at users.sourceforge.net
Sun Sep 3 10:39:17 CEST 2006


Revision: 23826
          http://svn.sourceforge.net/scummvm/?rev=23826&view=rev
Author:   dreammaster
Date:     2006-09-03 01:39:06 -0700 (Sun, 03 Sep 2006)

Log Message:
-----------
Fixed handling of player occupied areas during room changes

Modified Paths:
--------------
    scummvm/trunk/engines/lure/game.cpp
    scummvm/trunk/engines/lure/hotspots.cpp
    scummvm/trunk/engines/lure/hotspots.h

Modified: scummvm/trunk/engines/lure/game.cpp
===================================================================
--- scummvm/trunk/engines/lure/game.cpp	2006-09-03 05:04:58 UTC (rev 23825)
+++ scummvm/trunk/engines/lure/game.cpp	2006-09-03 08:39:06 UTC (rev 23826)
@@ -259,6 +259,7 @@
 	player->setRoomNumber(roomNum);
 	//player->setPosition((newPos.x & 0xfff8) || 5, newPos.y & 0xfff8);
 	player->setPosition(newPos.x, newPos.y);
+	player->setOccupied(true);
 	room.setRoomNumber(roomNum, false);
 }
 

Modified: scummvm/trunk/engines/lure/hotspots.cpp
===================================================================
--- scummvm/trunk/engines/lure/hotspots.cpp	2006-09-03 05:04:58 UTC (rev 23825)
+++ scummvm/trunk/engines/lure/hotspots.cpp	2006-09-03 08:39:06 UTC (rev 23826)
@@ -2146,9 +2146,10 @@
 				// 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 @@
 			}
 
 			// 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 @@
 
 // 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 @@
 				exitRec->x, exitRec->y, exitRec->direction);
 		}
 	}
+
+	return (exitRec != NULL);
 }
 
 void Support::characterChangeRoom(Hotspot &h, uint16 roomNumber, 

Modified: scummvm/trunk/engines/lure/hotspots.h
===================================================================
--- scummvm/trunk/engines/lure/hotspots.h	2006-09-03 05:04:58 UTC (rev 23825)
+++ scummvm/trunk/engines/lure/hotspots.h	2006-09-03 08:39:06 UTC (rev 23826)
@@ -40,7 +40,7 @@
 public:
 	static int findIntersectingCharacters(Hotspot &h, uint16 *charList); 
 	static bool checkForIntersectingCharacter(Hotspot &h);
-	static void checkRoomChange(Hotspot &h);
+	static bool checkRoomChange(Hotspot &h);
 	static void characterChangeRoom(Hotspot &h, uint16 roomNumber, 
 								  int16 newX, int16 newY, Direction dir);
 	static bool charactersIntersecting(HotspotData *hotspot1, HotspotData *hotspot2);


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