diff options
author | Max Horn | 2004-07-31 23:34:07 +0000 |
---|---|---|
committer | Max Horn | 2004-07-31 23:34:07 +0000 |
commit | 7f5f1c141810ae83350bfcbafa24632a88363aca (patch) | |
tree | 084b42aa526050b83ae04c4a2579e26840df0766 | |
parent | 46a1c45d70bbfb6654a9c13e26949a4543d17e80 (diff) | |
download | scummvm-rg350-7f5f1c141810ae83350bfcbafa24632a88363aca.tar.gz scummvm-rg350-7f5f1c141810ae83350bfcbafa24632a88363aca.tar.bz2 scummvm-rg350-7f5f1c141810ae83350bfcbafa24632a88363aca.zip |
Fix for bug #941275 (FOA: Game crashes when clicking statue part (Sentry Statue))
svn-id: r14398
-rw-r--r-- | scumm/script.cpp | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/scumm/script.cpp b/scumm/script.cpp index 7909b464c1..fda1188e34 100644 --- a/scumm/script.cpp +++ b/scumm/script.cpp @@ -843,10 +843,23 @@ void ScummEngine::killScriptsAndResources() { /* Nuke local object names */ if (_newNames) { for (i = 0; i < _numNewNames; i++) { - int j = _newNames[i]; - if (j && getOwner(j) == 0) { - _newNames[i] = 0; - nukeResource(rtObjectName, i); + const int obj = _newNames[i]; + if (obj) { + const int owner = getOwner(obj); + // We can delete custom name resources if either the object is + // no longer in use (i.e. not owned by anyone anymore); or if + // it is an object which is owned by a room. + if (owner == 0 || owner == OF_OWNER_ROOM) { + // WORKAROUND for a problem mentioned in bug report #941275: + // In FOA in the sentry room, in the chest plate of the statue, + // the pegs may be renamed to mouth: this custom name is lost + // when leaving the room; this hack prevents this). + if (owner == OF_OWNER_ROOM && _gameId == GID_INDY4 && 336 <= obj && obj <= 340) + continue; + + _newNames[i] = 0; + nukeResource(rtObjectName, i); + } } } } |