From bb22e2205096d08a3e210ce2280fd3576776a34b Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Sun, 29 Jul 2007 19:06:17 +0000 Subject: Inventory icons in the IHNM demo are displayed correctly now svn-id: r28313 --- engines/saga/sfuncs.cpp | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) (limited to 'engines') diff --git a/engines/saga/sfuncs.cpp b/engines/saga/sfuncs.cpp index 1e9460c898..fed3f36a6f 100644 --- a/engines/saga/sfuncs.cpp +++ b/engines/saga/sfuncs.cpp @@ -277,7 +277,16 @@ void Script::sfTakeObject(SCRIPTFUNC_PARAMS) { obj = _vm->_actor->getObj(objectId); if (obj->_sceneNumber != ITE_SCENE_INV) { obj->_sceneNumber = ITE_SCENE_INV; - //4debug for (int j=0;j<17;j++) + + // WORKAROUND for two incorrect object sprites in the IHNM demo + // (the mirror and the icon in Ted's part). Set them correctly here + if (_vm->getGameId() == GID_IHNM_DEMO) { + if (obj->_spriteListResourceId == 4) + obj->_spriteListResourceId = 24; + if (obj->_spriteListResourceId == 3) + obj->_spriteListResourceId = 25; + } + _vm->_interface->addToInventory(objectId); } } @@ -870,10 +879,16 @@ void Script::sfDropObject(SCRIPTFUNC_PARAMS) { _vm->_scene->currentSceneNumber() == 59 && obj->_id == 16385) obj->_sceneNumber = -1; - if (_vm->getGameType() == GType_IHNM) - obj->_spriteListResourceId = spriteId; - else + if (_vm->getGameType() == GType_IHNM) { + if (_vm->getGameId() != GID_IHNM_DEMO) { + obj->_spriteListResourceId = spriteId; + } else { + // Don't update the object's _spriteListResourceId in the IHNM demo, as this function is + // called incorrectly there (with spriteId == 0, which resets the object sprites) + } + } else { obj->_spriteListResourceId = OBJ_SPRITE_BASE + spriteId; + } obj->_location.x = x; obj->_location.y = y; -- cgit v1.2.3