From ce6eb1636b7cdc44f483bfea201acc19e0fdb8c8 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Mon, 15 Jan 2018 21:16:18 -0500 Subject: XEEN: Fix crash at end of combat turn --- engines/xeen/combat.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'engines/xeen/combat.cpp') 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; -- cgit v1.2.3