[Scummvm-cvs-logs] SF.net SVN: scummvm:[55641] scummvm/trunk/engines/toon

sylvaintv at users.sourceforge.net sylvaintv at users.sourceforge.net
Sun Jan 30 00:03:08 CET 2011


Revision: 55641
          http://scummvm.svn.sourceforge.net/scummvm/?rev=55641&view=rev
Author:   sylvaintv
Date:     2011-01-29 23:03:08 +0000 (Sat, 29 Jan 2011)

Log Message:
-----------
TOON: Bug #3124518 with disappearing inventory items fixed

Bug #3124518: "TOON: loss of inventory items in Bricabrac's machine room"
Was caused by recursive walkTo that were not canceling out.

Modified Paths:
--------------
    scummvm/trunk/engines/toon/character.cpp
    scummvm/trunk/engines/toon/character.h

Modified: scummvm/trunk/engines/toon/character.cpp
===================================================================
--- scummvm/trunk/engines/toon/character.cpp	2011-01-29 22:50:41 UTC (rev 55640)
+++ scummvm/trunk/engines/toon/character.cpp	2011-01-29 23:03:08 UTC (rev 55641)
@@ -58,6 +58,7 @@
 	_animSpecialDefaultId = 0;
 	_currentPathNodeCount = 0;
 	_currentPathNode = 0;
+	_currentWalkStamp = 0;
 	_visible = true;
 	_speed = 150;   // 150 = nominal drew speed
 	_lastWalkTime = 0;
@@ -192,6 +193,10 @@
 
 		_flags |= 0x1;
 
+		_currentWalkStamp++;
+
+		int32 localWalkStamp = _currentWalkStamp;
+
 		if (_blockingWalk) {
 			while ((_x != newPosX || _y != newPosY) && _currentPathNode < _currentPathNodeCount && !_vm->shouldQuitGame()) {
 				if (_currentPathNode < _currentPathNodeCount - 4) {
@@ -226,6 +231,11 @@
 				setPosition(_x, _y);
 
 				_vm->doFrame();
+				if (_currentWalkStamp != localWalkStamp) {
+					// another walkTo was started in doFrame, we need to cancel this one.
+					return false;
+				}
+
 			}
 			playStandingAnim();
 			_flags &= ~0x1;
@@ -238,8 +248,6 @@
 		}
 	}
 
-	//_vm->getPathFinding()->findClosestWalkingPoint(newPosX, newPosY, &_x, &_y, _x, _y);
-	//setPosition(_x,_y);
 	return true;
 }
 

Modified: scummvm/trunk/engines/toon/character.h
===================================================================
--- scummvm/trunk/engines/toon/character.h	2011-01-29 22:50:41 UTC (rev 55640)
+++ scummvm/trunk/engines/toon/character.h	2011-01-29 23:03:08 UTC (rev 55641)
@@ -146,6 +146,7 @@
 	int32 _currentPathY[4096];
 	int32 _currentPathNodeCount;
 	int32 _currentPathNode;
+	int32 _currentWalkStamp;
 };
 
 } // End of namespace Toon


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