diff options
-rw-r--r-- | saga/sfuncs.cpp | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/saga/sfuncs.cpp b/saga/sfuncs.cpp index 58f374033a..ce458c0640 100644 --- a/saga/sfuncs.cpp +++ b/saga/sfuncs.cpp @@ -348,10 +348,18 @@ int Script::SF_gotoScene(SCRIPTFUNC_PARAMS) { // Script function #17 (0x11) int Script::SF_setObjImage(SCRIPTFUNC_PARAMS) { - for (int i = 0; i < nArgs; i++) - thread->pop(); + SDataWord_T obj_param = thread->pop(); + SDataWord_T sprite_param = thread->pop(); + + int index = obj_param & 0x1FFF; + + if (index >= ARRAYSIZE(ObjectTable)) { + return FAILURE; + } + + ObjectTable[index].spritelistRn = sprite_param + 9; + _vm->_interface->draw(); - debug(1, "stub: SF_setObjImage(), %d args", nArgs); return SUCCESS; } |