aboutsummaryrefslogtreecommitdiff
path: root/saga
diff options
context:
space:
mode:
authorAndrew Kurushin2005-06-04 17:52:37 +0000
committerAndrew Kurushin2005-06-04 17:52:37 +0000
commit697124a1b9f45a055402ea24f251e9fae0b9590d (patch)
treeab90db66ff51cc476f4be7f5073c71a7b02db22a /saga
parentfeac08c9f713c78330006ea60eb4f9e364ccc092 (diff)
downloadscummvm-rg350-697124a1b9f45a055402ea24f251e9fae0b9590d.tar.gz
scummvm-rg350-697124a1b9f45a055402ea24f251e9fae0b9590d.tar.bz2
scummvm-rg350-697124a1b9f45a055402ea24f251e9fae0b9590d.zip
fixed dog's castle bug
svn-id: r18344
Diffstat (limited to 'saga')
-rw-r--r--saga/sfuncs.cpp25
1 files changed, 17 insertions, 8 deletions
diff --git a/saga/sfuncs.cpp b/saga/sfuncs.cpp
index cebd7fa910..b8d91a0653 100644
--- a/saga/sfuncs.cpp
+++ b/saga/sfuncs.cpp
@@ -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)