aboutsummaryrefslogtreecommitdiff
path: root/engines/gob
diff options
context:
space:
mode:
authorSven Hesse2010-10-25 03:39:28 +0000
committerSven Hesse2010-10-25 03:39:28 +0000
commit9605cda50ba32dfb96020ffe4dc92c2353cad222 (patch)
tree9f2049ad7747c96b0c67c47aa15078d525891eff /engines/gob
parentf1d41b83264576beaa82e98a5dfef3663020f1ef (diff)
downloadscummvm-rg350-9605cda50ba32dfb96020ffe4dc92c2353cad222.tar.gz
scummvm-rg350-9605cda50ba32dfb96020ffe4dc92c2353cad222.tar.bz2
scummvm-rg350-9605cda50ba32dfb96020ffe4dc92c2353cad222.zip
GOB: Fix the Gob3 stairs walking bug
Fix the bug where blount keeps moving between two steps of wide stairs. svn-id: r53793
Diffstat (limited to 'engines/gob')
-rw-r--r--engines/gob/goblin.cpp43
1 files changed, 25 insertions, 18 deletions
diff --git a/engines/gob/goblin.cpp b/engines/gob/goblin.cpp
index d11c7c82ec..1d4996ce78 100644
--- a/engines/gob/goblin.cpp
+++ b/engines/gob/goblin.cpp
@@ -1781,40 +1781,47 @@ void Goblin::animate(Mult::Mult_Object *obj) {
}
void Goblin::move(int16 destX, int16 destY, int16 objIndex) {
- Mult::Mult_Object *obj;
- Mult::Mult_AnimData *animData;
- int16 mouseX;
- int16 mouseY;
- int16 gobDestX;
- int16 gobDestY;
- obj = &_vm->_mult->_objects[objIndex];
- animData = obj->pAnimData;
+ Mult::Mult_Object *obj = &_vm->_mult->_objects[objIndex];
+ Mult::Mult_AnimData *animData = obj->pAnimData;
- obj->gobDestX = destX;
- obj->gobDestY = destY;
+ obj->gobDestX = destX;
+ obj->gobDestY = destY;
animData->destX = destX;
animData->destY = destY;
if (animData->isBusy != 0) {
if ((destX == -1) && (destY == -1)) {
- mouseX = _vm->_global->_inter_mouseX;
- mouseY = _vm->_global->_inter_mouseY;
+ int16 mouseX = _vm->_global->_inter_mouseX;
+ int16 mouseY = _vm->_global->_inter_mouseY;
+
if (_vm->_map->_bigTiles)
mouseY += ((_vm->_global->_inter_mouseY / _vm->_map->_tilesHeight) + 1) / 2;
- gobDestX = mouseX / _vm->_map->_tilesWidth;
- gobDestY = mouseY / _vm->_map->_tilesHeight;
+ int16 gobDestX = mouseX / _vm->_map->_tilesWidth;
+ int16 gobDestY = mouseY / _vm->_map->_tilesHeight;
if (_vm->_map->getPass(gobDestX, gobDestY) == 0)
_vm->_map->findNearestWalkable(gobDestX, gobDestY, mouseX, mouseY);
- animData->destX = obj->gobDestX =
- (gobDestX == -1) ? obj->goblinX : gobDestX;
- animData->destY = obj->gobDestY =
- (gobDestY == -1) ? obj->goblinY : gobDestY;
+ obj->gobDestX = (gobDestX == -1) ? obj->goblinX : gobDestX;
+ obj->gobDestY = (gobDestY == -1) ? obj->goblinY : gobDestY;
+
+ animData->destX = obj->gobDestX;
+ animData->destY = obj->gobDestY;
}
}
+
+ WRITE_VAR(56, 0);
+
+ // Prevent continous walking on wide stairs
+ if (_vm->_map->getPass(obj->gobDestX, obj->gobDestY) == 11) {
+ if (_vm->_map->_screenWidth == 640) {
+ obj->gobDestY++;
+ animData->destY++;
+ }
+ }
+
initiateMove(obj);
}