[Scummvm-git-logs] scummvm master -> cb022f39117765861effbe132b1f2a6885dfbf07

dreammaster dreammaster at scummvm.org
Wed Jan 31 01:13:34 CET 2018


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:
cb022f3911 XEEN: Explicitly use DT_PHYSICAL in DamageType field comparisons


Commit: cb022f39117765861effbe132b1f2a6885dfbf07
    https://github.com/scummvm/scummvm/commit/cb022f39117765861effbe132b1f2a6885dfbf07
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2018-01-30T19:12:55-05:00

Commit Message:
XEEN: Explicitly use DT_PHYSICAL in DamageType field comparisons

Changed paths:
    engines/xeen/combat.cpp


diff --git a/engines/xeen/combat.cpp b/engines/xeen/combat.cpp
index c7adf54..c60a55a 100644
--- a/engines/xeen/combat.cpp
+++ b/engines/xeen/combat.cpp
@@ -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;
 
@@ -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;
@@ -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];
@@ -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;





More information about the Scummvm-git-logs mailing list