[Scummvm-cvs-logs] scummvm master -> 114eff979d281341f9a7661a58b0ea2114fcfc7d
sylvaintv
sylvaintv at gmail.com
Sun Jun 30 01:19:13 CEST 2013
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
114eff979d TOON: Fix bug #3611869 - Drew sometimes ends up stuck walking forever
Commit: 114eff979d281341f9a7661a58b0ea2114fcfc7d
https://github.com/scummvm/scummvm/commit/114eff979d281341f9a7661a58b0ea2114fcfc7d
Author: sylvaintv (sylvaintv at gmail.com)
Date: 2013-06-29T16:18:07-07:00
Commit Message:
TOON: Fix bug #3611869 - Drew sometimes ends up stuck walking forever
Canceled old character setFacing when a new one is issued during
the character rotation.
Bug #3611869: "TOON: Drew sometimes ends up stuck walking forever"
Changed paths:
engines/toon/character.cpp
engines/toon/character.h
diff --git a/engines/toon/character.cpp b/engines/toon/character.cpp
index 479f496..83c9e3e 100644
--- a/engines/toon/character.cpp
+++ b/engines/toon/character.cpp
@@ -58,6 +58,7 @@ Character::Character(ToonEngine *vm) : _vm(vm) {
_animSpecialDefaultId = 0;
_currentPathNode = 0;
_currentWalkStamp = 0;
+ _currentFacingStamp = 0;
_visible = true;
_speed = 150; // 150 = nominal drew speed
_lastWalkTime = 0;
@@ -99,6 +100,9 @@ void Character::setFacing(int32 facing) {
if (_blockingWalk) {
_flags |= 2;
+ _currentFacingStamp++;
+ int32 localFacingStamp = _currentFacingStamp;
+
int32 dir = 0;
_lastWalkTime = _vm->_system->getMillis();
@@ -127,6 +131,11 @@ void Character::setFacing(int32 facing) {
else
playWalkAnim(0, 0);
_vm->doFrame();
+
+ if (_currentFacingStamp != localFacingStamp) {
+ // another setFacing was started in doFrame, we need to cancel this one.
+ return;
+ }
};
_flags &= ~2;
diff --git a/engines/toon/character.h b/engines/toon/character.h
index d33c314..b248e7c 100644
--- a/engines/toon/character.h
+++ b/engines/toon/character.h
@@ -143,6 +143,7 @@ protected:
Common::Array<Common::Point> _currentPath;
uint32 _currentPathNode;
int32 _currentWalkStamp;
+ int32 _currentFacingStamp;
};
} // End of namespace Toon
More information about the Scummvm-git-logs
mailing list