mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-18 16:03:05 +00:00
MADS: Fix player animation when getting blown up by mine
This commit is contained in:
parent
4f6f0fb148
commit
df5742eee4
@ -240,8 +240,13 @@ void Player::updateFrame() {
|
||||
return;
|
||||
|
||||
Scene &scene = _vm->_game->_scene;
|
||||
assert(scene._sprites[idx] != nullptr);
|
||||
SpriteAsset &spriteSet = *scene._sprites[idx];
|
||||
assert(spriteSet._charInfo);
|
||||
|
||||
// WORKAROUND: Certain cutscenes set up player sprites that don't have any
|
||||
// character info. In such cases, simply ignore player updates
|
||||
if (!spriteSet._charInfo)
|
||||
return;
|
||||
|
||||
if (!spriteSet._charInfo->_numEntries) {
|
||||
_frameNumber = 1;
|
||||
@ -515,8 +520,7 @@ void Player::idle() {
|
||||
return;
|
||||
|
||||
SpriteAsset &spriteSet = *scene._sprites[idx];
|
||||
assert(spriteSet._charInfo);
|
||||
if (spriteSet._charInfo->_numEntries == 0)
|
||||
if (spriteSet._charInfo == nullptr || spriteSet._charInfo->_numEntries == 0)
|
||||
// No entries, so exit immediately
|
||||
return;
|
||||
|
||||
|
@ -371,16 +371,13 @@ int SpriteSets::add(SpriteAsset *asset, int idx) {
|
||||
if (idx)
|
||||
idx = idx + 49;
|
||||
else
|
||||
idx = size();
|
||||
idx = _assetCount++;
|
||||
|
||||
if (idx >= (int)size())
|
||||
resize(idx + 1);
|
||||
|
||||
if ((*this)[idx]) {
|
||||
if ((*this)[idx])
|
||||
delete (*this)[idx];
|
||||
} else {
|
||||
++_assetCount;
|
||||
}
|
||||
|
||||
(*this)[idx] = asset;
|
||||
return idx;
|
||||
|
Loading…
x
Reference in New Issue
Block a user