diff options
-rw-r--r-- | engines/mads/game.cpp | 4 | ||||
-rw-r--r-- | engines/mads/player.cpp | 10 |
2 files changed, 12 insertions, 2 deletions
diff --git a/engines/mads/game.cpp b/engines/mads/game.cpp index bf3822da09..82a7b66c92 100644 --- a/engines/mads/game.cpp +++ b/engines/mads/game.cpp @@ -274,8 +274,8 @@ void Game::sectionLoop() { _vm->_events->waitCursor(); _kernelMode = KERNEL_ROOM_PRELOAD; - delete _scene._animationData; - _scene._animationData = nullptr; + delete _scene._activeAnimation; + _scene._activeAnimation = nullptr; _scene._reloadSceneFlag = false; diff --git a/engines/mads/player.cpp b/engines/mads/player.cpp index b55d3f0285..9301fdc50a 100644 --- a/engines/mads/player.cpp +++ b/engines/mads/player.cpp @@ -201,6 +201,10 @@ void Player::selectSeries() { _mirror = true; } + // If the user isn't to be present (such as for a cutscene), exit immediately + if ((_spritesStart + _spritesIdx) < 0) + return; + SpriteAsset &spriteSet = *scene._sprites[_spritesStart + _spritesIdx]; assert(spriteSet._charInfo); _velocity = MAX(spriteSet._charInfo->_velocity, 100); @@ -219,6 +223,9 @@ void Player::selectSeries() { } void Player::updateFrame() { + if ((_spritesStart + _spritesIdx) < 0) + return; + Scene &scene = _vm->_game->_scene; SpriteAsset &spriteSet = *scene._sprites[_spritesStart + _spritesIdx]; assert(spriteSet._charInfo); @@ -490,6 +497,9 @@ void Player::idle() { return; } + if ((_spritesStart + _spritesIdx) < 0) + return; + SpriteAsset &spriteSet = *scene._sprites[_spritesStart + _spritesIdx]; assert(spriteSet._charInfo); if (spriteSet._charInfo->_numEntries == 0) |