diff options
author | Sven Hesse | 2012-06-28 01:30:29 +0200 |
---|---|---|
committer | Sven Hesse | 2012-07-30 01:24:18 +0200 |
commit | 099a76ea20fa0f8290815f988d2202b6702d589b (patch) | |
tree | 97f8f3e59307f56a7ce157b3d50b60ebfc37f8b7 /engines | |
parent | 945115f09927ff2e9e7d5197524bb929f4ba5561 (diff) | |
download | scummvm-rg350-099a76ea20fa0f8290815f988d2202b6702d589b.tar.gz scummvm-rg350-099a76ea20fa0f8290815f988d2202b6702d589b.tar.bz2 scummvm-rg350-099a76ea20fa0f8290815f988d2202b6702d589b.zip |
GOB: Don't crash when there's no _inter object
Diffstat (limited to 'engines')
-rw-r--r-- | engines/gob/draw.cpp | 6 | ||||
-rw-r--r-- | engines/gob/gob.cpp | 5 |
2 files changed, 6 insertions, 5 deletions
diff --git a/engines/gob/draw.cpp b/engines/gob/draw.cpp index fe59b11f76..9253a0a242 100644 --- a/engines/gob/draw.cpp +++ b/engines/gob/draw.cpp @@ -256,7 +256,7 @@ void Draw::blitInvalidated() { if (_cursorIndex == 4) blitCursor(); - if (_vm->_inter->_terminate) + if (_vm->_inter && _vm->_inter->_terminate) return; if (_noInvalidated && !_applyPal) @@ -446,7 +446,7 @@ void Draw::printTextCentered(int16 id, int16 left, int16 top, int16 right, adjustCoords(1, &left, &top); adjustCoords(1, &right, &bottom); - uint16 centerOffset = _vm->_game->_script->getFunctionOffset(TOTFile::kFunctionCenter); + uint16 centerOffset = _vm->_game->_script ? _vm->_game->_script->getFunctionOffset(TOTFile::kFunctionCenter) : 0; if (centerOffset != 0) { _vm->_game->_script->call(centerOffset); @@ -505,7 +505,7 @@ void Draw::oPlaytoons_sub_F_1B(uint16 id, int16 left, int16 top, int16 right, in adjustCoords(1, &left, &top); adjustCoords(1, &right, &bottom); - uint16 centerOffset = _vm->_game->_script->getFunctionOffset(TOTFile::kFunctionCenter); + uint16 centerOffset = _vm->_game->_script ? _vm->_game->_script->getFunctionOffset(TOTFile::kFunctionCenter) : 0; if (centerOffset != 0) { _vm->_game->_script->call(centerOffset); diff --git a/engines/gob/gob.cpp b/engines/gob/gob.cpp index 3202b5e23d..ef9a7112f9 100644 --- a/engines/gob/gob.cpp +++ b/engines/gob/gob.cpp @@ -368,11 +368,12 @@ void GobEngine::pauseEngineIntern(bool pause) { _game->_startTimeKey += duration; _draw->_cursorTimeKey += duration; - if (_inter->_soundEndTimeKey != 0) + if (_inter && (_inter->_soundEndTimeKey != 0)) _inter->_soundEndTimeKey += duration; } - _vidPlayer->pauseAll(pause); + if (_vidPlayer) + _vidPlayer->pauseAll(pause); _mixer->pauseAll(pause); } |