aboutsummaryrefslogtreecommitdiff
path: root/engines/xeen
diff options
context:
space:
mode:
authorPaul Gilbert2017-12-09 12:40:28 -0500
committerPaul Gilbert2017-12-09 12:40:28 -0500
commit61a33af8b47eb3f80bd88abfd6f4f00c20ade538 (patch)
treeddefdc3c84db4ac1ce192294dd917da313a54b48 /engines/xeen
parent75102d4274476ac2cd4da27d26ab76af88f25880 (diff)
downloadscummvm-rg350-61a33af8b47eb3f80bd88abfd6f4f00c20ade538.tar.gz
scummvm-rg350-61a33af8b47eb3f80bd88abfd6f4f00c20ade538.tar.bz2
scummvm-rg350-61a33af8b47eb3f80bd88abfd6f4f00c20ade538.zip
XEEN: Fix outdoors monsters disappearing from view
Diffstat (limited to 'engines/xeen')
-rw-r--r--engines/xeen/combat.cpp2
-rw-r--r--engines/xeen/combat.h3
-rw-r--r--engines/xeen/interface_scene.cpp9
3 files changed, 11 insertions, 3 deletions
diff --git a/engines/xeen/combat.cpp b/engines/xeen/combat.cpp
index 866cb8a852..fe2eaa94bf 100644
--- a/engines/xeen/combat.cpp
+++ b/engines/xeen/combat.cpp
@@ -128,7 +128,7 @@ Combat::Combat(XeenEngine *vm): _vm(vm), _missVoc("miss.voc"), _pow1Voc("pow1.vo
}
void Combat::clear() {
- Common::fill(&_attackMonsters[0], &_attackMonsters[26], -1);
+ Common::fill(&_attackMonsters[0], &_attackMonsters[ATTACK_MONSTERS_COUNT], -1);
}
void Combat::giveCharDamage(int damage, DamageType attackType, int charIndex) {
diff --git a/engines/xeen/combat.h b/engines/xeen/combat.h
index 3a79a2ea22..f3eaa39bd0 100644
--- a/engines/xeen/combat.h
+++ b/engines/xeen/combat.h
@@ -32,6 +32,7 @@ namespace Xeen {
#define MAX_NUM_MONSTERS 107
#define PARTY_AND_MONSTERS 12
+#define ATTACK_MONSTERS_COUNT 26
enum DamageType {
DT_PHYSICAL = 0, DT_MAGICAL = 1, DT_FIRE = 2, DT_ELECTRICAL = 3,
@@ -106,7 +107,7 @@ public:
Common::Array<bool> _charsBlocked;
Common::Array<int> _charsGone;
SpriteResource _powSprites;
- int _attackMonsters[26];
+ int _attackMonsters[ATTACK_MONSTERS_COUNT];
int _monster2Attack;
int _charsArray1[PARTY_AND_MONSTERS];
bool _monPow[PARTY_AND_MONSTERS];
diff --git a/engines/xeen/interface_scene.cpp b/engines/xeen/interface_scene.cpp
index 05815c5d1b..beadcb0b96 100644
--- a/engines/xeen/interface_scene.cpp
+++ b/engines/xeen/interface_scene.cpp
@@ -2315,7 +2315,10 @@ void InterfaceScene::setIndoorsMonsters() {
Common::Point mazePos = _vm->_party->_mazePosition;
Direction dir = _vm->_party->_mazeDirection;
+ // Reset the list of attacking monsters
combat.clear();
+
+ // Iterate through the monsters list checking for proximity to party
for (uint monsterIdx = 0; monsterIdx < map._mobData._monsters.size(); ++monsterIdx) {
MazeMonster &monster = map._mobData._monsters[monsterIdx];
SpriteResource *sprites = monster._sprites;
@@ -3097,6 +3100,10 @@ void InterfaceScene::setOutdoorsMonsters() {
Direction dir = party._mazeDirection;
Common::Point pt = party._mazePosition;
+ // Reset the list of attacking monsters
+ combat.clear();
+
+ // Iterate through the monsters list checking for proximity to party
for (uint idx = 0; idx < map._mobData._monsters.size(); ++idx) {
MazeMonster &monster = map._mobData._monsters[idx];
@@ -3309,7 +3316,7 @@ void InterfaceScene::setOutdoorsMonsters() {
_outdoorList[45]._x = -16;
}
- for (int idx = 0; idx < 26; ++idx) {
+ for (int idx = 0; idx < ATTACK_MONSTERS_COUNT; ++idx) {
DrawStruct &ds = _outdoorList[Res.OUTDOOR_MONSTER_INDEXES[idx]];
if (ds._frame != -1) {