aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/gob/goblin.h3
-rw-r--r--engines/gob/goblin_v2.cpp3
-rw-r--r--engines/gob/goblin_v3.cpp21
3 files changed, 24 insertions, 3 deletions
diff --git a/engines/gob/goblin.h b/engines/gob/goblin.h
index 7a698ced20..f8bddff332 100644
--- a/engines/gob/goblin.h
+++ b/engines/gob/goblin.h
@@ -302,6 +302,9 @@ protected:
class Goblin_v3 : public Goblin_v2 {
public:
+ virtual void placeObject(Gob_Object * objDesc, char animated,
+ int16 index, int16 x, int16 y, int16 state);
+
Goblin_v3(GobEngine *vm);
virtual ~Goblin_v3() {};
diff --git a/engines/gob/goblin_v2.cpp b/engines/gob/goblin_v2.cpp
index caa473464c..29401837a7 100644
--- a/engines/gob/goblin_v2.cpp
+++ b/engines/gob/goblin_v2.cpp
@@ -426,9 +426,6 @@ void Goblin_v2::moveAdvance(Mult::Mult_Object *obj, Gob_Object *gobDesc,
}
if (animData->frame >= framesCount) {
- if (animData->nextState == -1) // TODO: This should never happen
- return;
-
state = animData->nextState;
animation = obj->goblinStates[state][0].animation;
layer = obj->goblinStates[state][0].layer;
diff --git a/engines/gob/goblin_v3.cpp b/engines/gob/goblin_v3.cpp
index 6c250ef396..1a3a34fcec 100644
--- a/engines/gob/goblin_v3.cpp
+++ b/engines/gob/goblin_v3.cpp
@@ -107,4 +107,25 @@ void Goblin_v3::advMovement(Mult::Mult_Object *obj, int8 state) {
}
}
+void Goblin_v3::placeObject(Gob_Object *objDesc, char animated,
+ int16 index, int16 x, int16 y, int16 state) {
+
+ Mult::Mult_Object &obj = _vm->_mult->_objects[index];
+ Mult::Mult_AnimData &objAnim = *(obj.pAnimData);
+
+ if ((state != -1) && (obj.goblinStates[state] != 0)) {
+ if (state == 8)
+ objAnim.curLookDir = 0;
+ else if (state == 9)
+ objAnim.curLookDir = 4;
+ else if (state == 28)
+ objAnim.curLookDir = 6;
+ else if (state == 29)
+ objAnim.curLookDir = 2;
+ }
+
+ Goblin_v2::placeObject(objDesc, animated, index, x, y, state);
+
+}
+
} // End of namespace Gob