[Scummvm-git-logs] scummvm master -> 61a33af8b47eb3f80bd88abfd6f4f00c20ade538

dreammaster dreammaster at scummvm.org
Sat Dec 9 18:40:39 CET 2017


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
61a33af8b4 XEEN: Fix outdoors monsters disappearing from view


Commit: 61a33af8b47eb3f80bd88abfd6f4f00c20ade538
    https://github.com/scummvm/scummvm/commit/61a33af8b47eb3f80bd88abfd6f4f00c20ade538
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2017-12-09T12:40:28-05:00

Commit Message:
XEEN: Fix outdoors monsters disappearing from view

Changed paths:
    engines/xeen/combat.cpp
    engines/xeen/combat.h
    engines/xeen/interface_scene.cpp


diff --git a/engines/xeen/combat.cpp b/engines/xeen/combat.cpp
index 866cb8a..fe2eaa9 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 3a79a2e..f3eaa39 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 05815c5..beadcb0 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) {





More information about the Scummvm-git-logs mailing list