aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorPaul Gilbert2018-04-01 17:18:37 -0400
committerPaul Gilbert2018-04-01 17:18:37 -0400
commit396076c6fd9a74966357074ea9cc5b51f1181f96 (patch)
tree79cc714fa969f41d1f9954cbab49572c511911af /engines
parent05c8c83b1652f8553c3be2783a40b2489355ae9e (diff)
downloadscummvm-rg350-396076c6fd9a74966357074ea9cc5b51f1181f96.tar.gz
scummvm-rg350-396076c6fd9a74966357074ea9cc5b51f1181f96.tar.bz2
scummvm-rg350-396076c6fd9a74966357074ea9cc5b51f1181f96.zip
XEEN: Fix combat crash when additional monsters join the front row
Diffstat (limited to 'engines')
-rw-r--r--engines/xeen/combat.h2
-rw-r--r--engines/xeen/interface.cpp10
2 files changed, 5 insertions, 7 deletions
diff --git a/engines/xeen/combat.h b/engines/xeen/combat.h
index 6dc20a01fb..5d27dc5c4e 100644
--- a/engines/xeen/combat.h
+++ b/engines/xeen/combat.h
@@ -151,7 +151,7 @@ private:
public:
Common::Array<Character *> _combatParty;
bool _charsBlocked[PARTY_AND_MONSTERS];
- Common::Array<int> _charsGone;
+ int _charsGone[PARTY_AND_MONSTERS];
SpriteResource _powSprites;
int _attackMonsters[ATTACK_MONSTERS_COUNT];
int _monster2Attack;
diff --git a/engines/xeen/interface.cpp b/engines/xeen/interface.cpp
index 8e973f793e..8e52aae7ae 100644
--- a/engines/xeen/interface.cpp
+++ b/engines/xeen/interface.cpp
@@ -1462,7 +1462,6 @@ void Interface::doCombat() {
mainIconsPrint();
combat._combatParty.clear();
- combat._charsGone.clear();
combat.clearBlocked();
combat._pow[0]._duration = 0;
combat._pow[1]._duration = 0;
@@ -1475,9 +1474,8 @@ void Interface::doCombat() {
combat.setSpeedTable();
// Initialize arrays for character/monster states
- combat._charsGone.resize(combat._speedTable.size());
- Common::fill(&combat._charsGone[0], &combat._charsGone[0] + combat._speedTable.size(), 0);
- Common::fill(&combat._charsBlocked[0], &combat._charsBlocked[0] + combat._speedTable.size(), false);
+ Common::fill(&combat._charsGone[0], &combat._charsGone[PARTY_AND_MONSTERS], 0);
+ Common::fill(&combat._charsBlocked[0], &combat._charsBlocked[PARTY_AND_MONSTERS], false);
combat._whosSpeed = -1;
combat._whosTurn = -1;
@@ -1657,7 +1655,7 @@ void Interface::doCombat() {
// Handling for if the combat turn is complete
if (combat.allHaveGone()) {
- Common::fill(&combat._charsGone[0], &combat._charsGone[0] + combat._charsGone.size(), false);
+ Common::fill(&combat._charsGone[0], &combat._charsGone[PARTY_AND_MONSTERS], false);
combat.clearBlocked();
combat.setSpeedTable();
combat._whosTurn = -1;
@@ -1796,7 +1794,7 @@ void Interface::nextChar() {
combat.setSpeedTable();
combat._whosTurn = -1;
combat._whosSpeed = -1;
- Common::fill(&combat._charsGone[0], &combat._charsGone[0] + combat._charsGone.size(), 0);
+ Common::fill(&combat._charsGone[0], &combat._charsGone[PARTY_AND_MONSTERS], false);
continue;
}