aboutsummaryrefslogtreecommitdiff
path: root/engines/gob
diff options
context:
space:
mode:
authorSven Hesse2006-08-16 20:52:43 +0000
committerSven Hesse2006-08-16 20:52:43 +0000
commit0f6d8ab269baa40320ff1cdb7ab5a52b224371c9 (patch)
treea2ca6bad34146fb506752e5d5185a5d9dc60ecc7 /engines/gob
parentb437f343a867161f987ef996af1e3b4efd8fdb53 (diff)
downloadscummvm-rg350-0f6d8ab269baa40320ff1cdb7ab5a52b224371c9.tar.gz
scummvm-rg350-0f6d8ab269baa40320ff1cdb7ab5a52b224371c9.tar.bz2
scummvm-rg350-0f6d8ab269baa40320ff1cdb7ab5a52b224371c9.zip
Fixed pathfinding
svn-id: r23718
Diffstat (limited to 'engines/gob')
-rw-r--r--engines/gob/game_v2.cpp3
-rw-r--r--engines/gob/goblin_v2.cpp9
2 files changed, 7 insertions, 5 deletions
diff --git a/engines/gob/game_v2.cpp b/engines/gob/game_v2.cpp
index b81819f3f2..31f2d43149 100644
--- a/engines/gob/game_v2.cpp
+++ b/engines/gob/game_v2.cpp
@@ -260,9 +260,10 @@ void Game_v2::playTot(int16 skipPlay) {
strcpy(_curTotFile, _totToLoad);
}
} else {
+ _vm->_inter->initControlVars(0);
_vm->_scenery->_pCaptureCounter = oldCaptureCounter;
_vm->_global->_inter_execPtr = (char *)_totFileData;
- _vm->_global->_inter_execPtr += READ_LE_UINT16(_totFileData + (skipPlay << 1) + 0x66);
+ _vm->_global->_inter_execPtr += (int16) READ_LE_UINT16(_totFileData + (skipPlay << 1) + 0x66);
_vm->_inter->callSub(2);
if (_vm->_inter->_terminate != 0)
_vm->_inter->_terminate = 2;
diff --git a/engines/gob/goblin_v2.cpp b/engines/gob/goblin_v2.cpp
index d8f9ab4aa3..44d26c6bc9 100644
--- a/engines/gob/goblin_v2.cpp
+++ b/engines/gob/goblin_v2.cpp
@@ -140,6 +140,7 @@ void Goblin_v2::movePathFind(Mult::Mult_Object *obj, Gob_Object *gobDesc, int16
animData = obj->pAnimData;
framesCount =
_vm->_scenery->_animations[(int)animData->animation].layers[animData->layer].framesCount;
+ animData->newCycle = framesCount;
gobX = obj->goblinX;
gobY = obj->goblinY;
animData->order = gobY;
@@ -224,7 +225,7 @@ void Goblin_v2::movePathFind(Mult::Mult_Object *obj, Gob_Object *gobDesc, int16
break;
case Map::kDirN:
- animData->nextState = animData->curLookDir == 2 ? 2 : rotateState(2, animData->curLookDir);
+ animData->nextState = animData->curLookDir == 2 ? 2 : rotateState(animData->curLookDir, 2);
if (_vm->_map->_screenWidth == 640) {
if (_vm->_map->getPass(obj->goblinX, obj->goblinY) == 10) {
if (_vm->_map->getPass(obj->goblinX - 1, obj->goblinY - 2) != 10) {
@@ -252,11 +253,11 @@ void Goblin_v2::movePathFind(Mult::Mult_Object *obj, Gob_Object *gobDesc, int16
break;
case Map::kDirW:
- animData->nextState = rotateState(0, animData->curLookDir);
+ animData->nextState = rotateState(animData->curLookDir, 0);
break;
case Map::kDirE:
- animData->nextState = rotateState(4, animData->curLookDir);
+ animData->nextState = rotateState(animData->curLookDir, 4);
break;
case Map::kDirSW:
@@ -270,7 +271,7 @@ void Goblin_v2::movePathFind(Mult::Mult_Object *obj, Gob_Object *gobDesc, int16
break;
case Map::kDirS:
- animData->nextState = animData->curLookDir == 6 ? 6 : rotateState(6, animData->curLookDir);
+ animData->nextState = animData->curLookDir == 6 ? 6 : rotateState(animData->curLookDir, 6);
if (_vm->_map->_screenWidth == 640) {
if (_vm->_map->getPass(obj->goblinX, obj->goblinY) == 20)
animData->nextState = 39;