From c84d9c1588ec3c7531dd4c0146369e6b35e5c059 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Sun, 9 Dec 2007 15:43:08 +0000 Subject: Fix to prevent having an incorrect sprite assigned to some objects in IHNM when those objects are dropped in the scene svn-id: r29796 --- engines/saga/sfuncs.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'engines/saga') diff --git a/engines/saga/sfuncs.cpp b/engines/saga/sfuncs.cpp index 74f192c7f7..b6865d6b0d 100644 --- a/engines/saga/sfuncs.cpp +++ b/engines/saga/sfuncs.cpp @@ -822,12 +822,12 @@ void Script::sfDropObject(SCRIPTFUNC_PARAMS) { obj->_sceneNumber = -1; if (_vm->getGameType() == GType_IHNM) { - if (_vm->getGameId() != GID_IHNM_DEMO) { + // Don't update _spriteListResourceId if spriteId is 0 and the object is not the + // psychic profile. If spriteId == 0, the object's sprite is incorrectly reset. + // This occurs in the IHNM demo and with some incorrect scripts in the retail version + // of the game + if (spriteId > 0 || (spriteId == 0 && objectId == IHNM_OBJ_PROFILE)) 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; } -- cgit v1.2.3