[Scummvm-cvs-logs] SF.net SVN: scummvm:[41770] scummvm/trunk/engines/gob
drmccoy at users.sourceforge.net
drmccoy at users.sourceforge.net
Mon Jun 22 18:29:31 CEST 2009
Revision: 41770
http://scummvm.svn.sourceforge.net/scummvm/?rev=41770&view=rev
Author: drmccoy
Date: 2009-06-22 16:29:31 +0000 (Mon, 22 Jun 2009)
Log Message:
-----------
Don't assert on pop when no script is loaded
Modified Paths:
--------------
scummvm/trunk/engines/gob/game_v1.cpp
scummvm/trunk/engines/gob/game_v2.cpp
scummvm/trunk/engines/gob/script.cpp
Modified: scummvm/trunk/engines/gob/game_v1.cpp
===================================================================
--- scummvm/trunk/engines/gob/game_v1.cpp 2009-06-22 16:29:16 UTC (rev 41769)
+++ scummvm/trunk/engines/gob/game_v1.cpp 2009-06-22 16:29:31 UTC (rev 41770)
@@ -242,8 +242,7 @@
_vm->_inter->_breakFromLevel = oldBreakFrom;
_vm->_scenery->_pCaptureCounter = oldCaptureCounter;
- if (_script->isLoaded())
- _script->pop();
+ _script->pop();
}
void Game_v1::clearCollisions() {
Modified: scummvm/trunk/engines/gob/game_v2.cpp
===================================================================
--- scummvm/trunk/engines/gob/game_v2.cpp 2009-06-22 16:29:16 UTC (rev 41769)
+++ scummvm/trunk/engines/gob/game_v2.cpp 2009-06-22 16:29:31 UTC (rev 41770)
@@ -293,8 +293,7 @@
_vm->_inter->_breakFromLevel = oldBreakFrom;
_vm->_scenery->_pCaptureCounter = oldCaptureCounter;
- if (_script->isLoaded())
- _script->pop();
+ _script->pop();
}
void Game_v2::clearCollisions() {
Modified: scummvm/trunk/engines/gob/script.cpp
===================================================================
--- scummvm/trunk/engines/gob/script.cpp 2009-06-22 16:29:16 UTC (rev 41769)
+++ scummvm/trunk/engines/gob/script.cpp 2009-06-22 16:29:31 UTC (rev 41770)
@@ -419,6 +419,10 @@
}
void Script::push() {
+ if (!isLoaded())
+ // Nothing to do
+ return;
+
CallEntry currentCall;
currentCall.totPtr = _totPtr;
@@ -428,6 +432,11 @@
}
void Script::pop(bool ret) {
+ if (!isLoaded())
+ // Nothing to do
+ return;
+
+ // Unmatched pop?
assert(!_callStack.empty());
CallEntry lastCall = _callStack.pop();
@@ -439,6 +448,10 @@
}
void Script::call(uint32 offset) {
+ if (!isLoaded())
+ // Nothing to do
+ return;
+
push();
seek(offset);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list