From 618e7f3e313c406a97876e83e1665bfa415e4340 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Tue, 23 Sep 2008 11:43:57 +0000 Subject: Fix for bug #1917981: Game crash when finishing Indy3 demo. At the same time, added a new paranoia check svn-id: r34635 --- engines/scumm/object.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'engines/scumm/object.cpp') diff --git a/engines/scumm/object.cpp b/engines/scumm/object.cpp index 8bcd92fd3b..eaffbd04bb 100644 --- a/engines/scumm/object.cpp +++ b/engines/scumm/object.cpp @@ -109,6 +109,13 @@ void ScummEngine::setOwnerOf(int obj, int owner) { int arg = (_game.version >= 6) ? obj : 0; + // WORKAROUND for bug #1917981: Game crash when finishing Indy3 demo. + // Script 94 tries to empty the inventory but does so in a bogus way. + // 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; + assert(obj > 0); + if (owner == 0) { clearOwnerOf(obj); -- cgit v1.2.3