fixed dog's castle bug

svn-id: r18344
This commit is contained in:
Andrew Kurushin 2005-06-04 17:52:37 +00:00
parent feac08c9f7
commit 697124a1b9

View File

@ -717,18 +717,27 @@ void Script::sfSetActorState(SCRIPTFUNC_PARAMS) {
// Param2: actor pos x
// Param3: actor pos y
void Script::sfScriptMoveTo(SCRIPTFUNC_PARAMS) {
int16 actorId;
Location actorLocation;
int16 objectId;
Location location;
ActorData *actor;
ObjectData *obj;
actorId = thread->pop();
actorLocation.x = thread->pop();
actorLocation.y = thread->pop();
objectId = thread->pop();
location.x = thread->pop();
location.y = thread->pop();
actor = _vm->_actor->getActor(actorId);
if (_vm->_actor->validActorId(objectId)) {
actor = _vm->_actor->getActor(objectId);
actor->location.x = actorLocation.x;
actor->location.y = actorLocation.y;
actor->location.x = location.x;
actor->location.y = location.y;
} else {
if (_vm->_actor->validObjId(objectId)) {
obj = _vm->_actor->getObj(objectId);
obj->location.x = location.x;
obj->location.y = location.y;
}
}
}
// Script function #31 (0x21)