Skip to content

Commit

Permalink
XEEN: Explicitly use DT_PHYSICAL in DamageType field comparisons
Browse files Browse the repository at this point in the history
  • Loading branch information
dreammaster committed Jan 31, 2018
1 parent 3025257 commit cb022f3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions engines/xeen/combat.cpp
Expand Up @@ -286,7 +286,7 @@ void Combat::doCharDamage(Character &c, int charNum, int monsterDataIndex) {


int fx = 29, frame = 0;
if (monsterData._attackType) {
if (monsterData._attackType != DT_PHYSICAL) {
if (c.charSavingThrow(monsterData._attackType))
damage /= 2;

Expand Down Expand Up @@ -491,7 +491,7 @@ void Combat::moveMonsters() {
// Check for range attacks
if (monsterData._rangeAttack && !_rangeAttacking[idx]
&& _attackMonsters[0] != idx && _attackMonsters[1] != idx
&& _attackMonsters[2] != idx && !monster._damageType) {
&& _attackMonsters[2] != idx && monster._damageType == DT_PHYSICAL) {
// Setup monster for attacking
setupMonsterAttack(monster._spriteId, pt);
_rangeAttacking[idx] = true;
Expand Down Expand Up @@ -727,7 +727,7 @@ void Combat::moveMonster(int monsterId, const Common::Point &moveDelta) {
MazeMonster &monster = map._mobData._monsters[monsterId];
Common::Point newPos = monster._position + moveDelta;

if (_monsterMap[newPos.y][newPos.x] < 3 && !monster._damageType && _moveMonsters) {
if (_monsterMap[newPos.y][newPos.x] < 3 && monster._damageType == DT_PHYSICAL && _moveMonsters) {
// Adjust monster's position
++_monsterMap[newPos.y][newPos.x];
--_monsterMap[monster._position.y][monster._position.x];
Expand Down Expand Up @@ -810,7 +810,7 @@ void Combat::doMonsterTurn(int monsterId) {
assert(monsterIndex != -1);
MazeMonster &monster = map._mobData._monsters[monsterIndex];
MonsterStruct &monsterData = *monster._monsterData;
if (monster._damageType)
if (monster._damageType != DT_PHYSICAL)
return;

monster._frame = 8;
Expand Down

0 comments on commit cb022f3

Please sign in to comment.