diff options
author | Paul Gilbert | 2014-04-16 08:27:13 -0400 |
---|---|---|
committer | Paul Gilbert | 2014-04-16 08:27:13 -0400 |
commit | 48f49eeb8029a36931373de1927aac8021783337 (patch) | |
tree | ef009cb342b007c776f05efbc2cbd73bf1c9d3a5 | |
parent | ec9c7166abe03e19a663082649fc5be12bc5dae5 (diff) | |
download | scummvm-rg350-48f49eeb8029a36931373de1927aac8021783337.tar.gz scummvm-rg350-48f49eeb8029a36931373de1927aac8021783337.tar.bz2 scummvm-rg350-48f49eeb8029a36931373de1927aac8021783337.zip |
MADS: Fix player/sprite setup/teardown for scene 112
-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) |