aboutsummaryrefslogtreecommitdiff
path: root/engines/xeen/combat.cpp
diff options
context:
space:
mode:
authorPaul Gilbert2018-01-15 21:16:18 -0500
committerPaul Gilbert2018-01-15 21:16:18 -0500
commitce6eb1636b7cdc44f483bfea201acc19e0fdb8c8 (patch)
tree26d9c8cf700b884e9fab1a094da7db307184550b /engines/xeen/combat.cpp
parent6ac8c8288cb67ae701701e571577b45791130db7 (diff)
downloadscummvm-rg350-ce6eb1636b7cdc44f483bfea201acc19e0fdb8c8.tar.gz
scummvm-rg350-ce6eb1636b7cdc44f483bfea201acc19e0fdb8c8.tar.bz2
scummvm-rg350-ce6eb1636b7cdc44f483bfea201acc19e0fdb8c8.zip
XEEN: Fix crash at end of combat turn
Diffstat (limited to 'engines/xeen/combat.cpp')
-rw-r--r--engines/xeen/combat.cpp6
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;