[Scummvm-cvs-logs] SF.net SVN: scummvm:[53794] scummvm/trunk/engines/gob/goblin.cpp
drmccoy at users.sourceforge.net
drmccoy at users.sourceforge.net
Mon Oct 25 05:39:58 CEST 2010
Revision: 53794
http://scummvm.svn.sourceforge.net/scummvm/?rev=53794&view=rev
Author: drmccoy
Date: 2010-10-25 03:39:58 +0000 (Mon, 25 Oct 2010)
Log Message:
-----------
GOB: Fix the Gob3 ladder walking bug
Fix the bug where Blount stops in the middle of big ladders.
Modified Paths:
--------------
scummvm/trunk/engines/gob/goblin.cpp
Modified: scummvm/trunk/engines/gob/goblin.cpp
===================================================================
--- scummvm/trunk/engines/gob/goblin.cpp 2010-10-25 03:39:28 UTC (rev 53793)
+++ scummvm/trunk/engines/gob/goblin.cpp 2010-10-25 03:39:58 UTC (rev 53794)
@@ -1814,14 +1814,36 @@
WRITE_VAR(56, 0);
+ byte passType = _vm->_map->getPass(obj->gobDestX, obj->gobDestY);
+
// Prevent continous walking on wide stairs
- if (_vm->_map->getPass(obj->gobDestX, obj->gobDestY) == 11) {
+ if (passType == 11) {
if (_vm->_map->_screenWidth == 640) {
obj->gobDestY++;
animData->destY++;
}
}
+ // Prevent stopping in the middle of big ladders
+ if ((passType == 19) || (passType == 20)) {
+ int ladderTop = 0;
+ while (_vm->_map->getPass(obj->gobDestX, obj->gobDestY + ladderTop) == passType)
+ ladderTop++;
+
+ int ladderBottom = 0;
+ while (_vm->_map->getPass(obj->gobDestX, obj->gobDestY + ladderBottom) == passType)
+ ladderBottom--;
+
+ int ladderDest;
+ if (ABS(ladderBottom) <= ladderTop)
+ ladderDest = obj->gobDestY + ladderBottom;
+ else
+ ladderDest = obj->gobDestY + ladderTop;
+
+ obj->gobDestY = ladderDest;
+ animData->destY = ladderDest;
+ }
+
initiateMove(obj);
}
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