diff options
author | Paul Gilbert | 2018-02-21 21:21:35 -0500 |
---|---|---|
committer | Paul Gilbert | 2018-02-23 15:23:20 -0500 |
commit | 5e0782c8da3becccfc5f647d346b44cd1860756e (patch) | |
tree | 81ddd1b9e79d7a1a2df36e3be17dd6d94265e197 | |
parent | ad7b947da324c7e3219e4fb2e47bce1006327d97 (diff) | |
download | scummvm-rg350-5e0782c8da3becccfc5f647d346b44cd1860756e.tar.gz scummvm-rg350-5e0782c8da3becccfc5f647d346b44cd1860756e.tar.bz2 scummvm-rg350-5e0782c8da3becccfc5f647d346b44cd1860756e.zip |
XEEN: Fix loading maps with no monsters
-rw-r--r-- | engines/xeen/map.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/engines/xeen/map.cpp b/engines/xeen/map.cpp index e3ab879e65..c62fc710a5 100644 --- a/engines/xeen/map.cpp +++ b/engines/xeen/map.cpp @@ -808,17 +808,18 @@ void MonsterObjectData::synchronize(XeenSerializer &s, MonsterData &monsterData) mon._sprites = &_monsterSprites[mon._id]._sprites; mon._attackSprites = &_monsterSprites[mon._id]._attackSprites; mon._monsterData = &monsterData[mon._spriteId]; + + MonsterStruct &md = *mon._monsterData; + mon._hp = md._hp; + mon._effect1 = mon._effect2 = md._animationEffect; + if (md._animationEffect) + mon._effect3 = _vm->getRandomNumber(7); + + _monsters.push_back(mon); } else { assert(!mon._id); } - MonsterStruct &md = *mon._monsterData; - mon._hp = md._hp; - mon._effect1 = mon._effect2 = md._animationEffect; - if (md._animationEffect) - mon._effect3 = _vm->getRandomNumber(7); - - _monsters.push_back(mon); mobStruct.synchronize(s); } while (mobStruct._id != 255 || mobStruct._pos.x != -1); |