aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Castricum2016-08-03 21:04:58 +0200
committerBen Castricum2016-08-30 09:06:43 +0200
commit13f810f57f8661ad3af567277abcf5da31f32bb0 (patch)
tree769f94c02ce3ca3f7e75e9f7ad6df6c487a0a310
parentc3335657f76e84ebe687597c383b5bad2e8847ba (diff)
downloadscummvm-rg350-13f810f57f8661ad3af567277abcf5da31f32bb0.tar.gz
scummvm-rg350-13f810f57f8661ad3af567277abcf5da31f32bb0.tar.bz2
scummvm-rg350-13f810f57f8661ad3af567277abcf5da31f32bb0.zip
SCUMM: Ignore SetOwnerOf call in specific case, fixes bug #6802
-rw-r--r--engines/scumm/object.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/engines/scumm/object.cpp b/engines/scumm/object.cpp
index da94a34baf..cbc24a8b7e 100644
--- a/engines/scumm/object.cpp
+++ b/engines/scumm/object.cpp
@@ -110,6 +110,16 @@ void ScummEngine::setOwnerOf(int obj, int owner) {
// This causes it to try to remove object 0 from the inventory.
if (_game.id == GID_PASS && obj == 0 && vm.slot[_currentScript].number == 94)
return;
+
+ // WORKAROUND for bug #6802: assert() was triggered in freddi2.
+ // Bug is in room 39. Problem is script 10, in the localvar2==78 case;
+ // this only sets the obj id if var198 is non-zero, but in the asserting
+ // case, it is obj 0. That means two setOwnerOf calls are made with obj 0.
+ // The correct setOwnerOf calls are made afterwards, so just ignoring this
+ // seems to work just fine.
+ if (_game.id == GID_HEGAME && obj == 0 && _currentRoom == 39 && vm.slot[_currentScript].number == 10)
+ return;
+
assert(obj > 0);
if (owner == 0) {