Small glitch/different goblin handling fix for Gob3

svn-id: r26436
This commit is contained in:
Sven Hesse 2007-04-09 15:40:10 +00:00
parent 0d99a362e9
commit 293be0bfa4
3 changed files with 24 additions and 3 deletions

View File

@ -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() {};

View File

@ -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;

View File

@ -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