diff options
author | Paul Gilbert | 2018-01-15 21:16:18 -0500 |
---|---|---|
committer | Paul Gilbert | 2018-01-15 21:16:18 -0500 |
commit | ce6eb1636b7cdc44f483bfea201acc19e0fdb8c8 (patch) | |
tree | 26d9c8cf700b884e9fab1a094da7db307184550b | |
parent | 6ac8c8288cb67ae701701e571577b45791130db7 (diff) | |
download | scummvm-rg350-ce6eb1636b7cdc44f483bfea201acc19e0fdb8c8.tar.gz scummvm-rg350-ce6eb1636b7cdc44f483bfea201acc19e0fdb8c8.tar.bz2 scummvm-rg350-ce6eb1636b7cdc44f483bfea201acc19e0fdb8c8.zip |
XEEN: Fix crash at end of combat turn
-rw-r--r-- | engines/xeen/combat.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/engines/xeen/combat.cpp b/engines/xeen/combat.cpp index c1c70ac86c..34246b69d1 100644 --- a/engines/xeen/combat.cpp +++ b/engines/xeen/combat.cpp @@ -1125,7 +1125,11 @@ void Combat::setSpeedTable() { } bool Combat::allHaveGone() const { - for (uint idx = 0; idx < _charsGone.size(); ++idx) { + int monsCount = (_attackMonsters[0] != -1 ? 1 : 0) + + (_attackMonsters[1] != -1 ? 1 : 0) + + (_attackMonsters[2] != -1 ? 1 : 0); + + for (uint idx = 0; idx < (_combatParty.size() + monsCount); ++idx) { if (!_charsGone[idx]) { if (idx >= _combatParty.size()) { return false; |