[Scummvm-git-logs] scummvm master -> 2a080979b8d0002a35edd0750de74b2dd4c05dea

Strangerke Strangerke at scummvm.org
Sun Oct 30 20:49:31 CET 2016


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:
2a080979b8 DM: Fix GCC warning (and potential bug)


Commit: 2a080979b8d0002a35edd0750de74b2dd4c05dea
    https://github.com/scummvm/scummvm/commit/2a080979b8d0002a35edd0750de74b2dd4c05dea
Author: Strangerke (strangerke at scummvm.org)
Date: 2016-10-30T12:38:32-07:00

Commit Message:
DM: Fix GCC warning (and potential bug)

Changed paths:
    engines/dm/group.cpp



diff --git a/engines/dm/group.cpp b/engines/dm/group.cpp
index cf748ff..a72342d 100644
--- a/engines/dm/group.cpp
+++ b/engines/dm/group.cpp
@@ -1672,7 +1672,10 @@ int16 GroupMan::getChampionDamage(Group *group, uint16 champIndex) {
 			uint16 poisonAttack = creatureInfo._poisonAttack;
 			if (poisonAttack && _vm->getRandomNumber(2)) {
 				poisonAttack = championMan.getStatisticAdjustedAttack(curChampion, kDMStatVitality, poisonAttack);
-				if (poisonAttack >= 0)
+
+				// Strangerke: In the original, the check was on >= 0, which is pretty useless for a unsigned variable.
+				// I changed the check to > 0 because, considering the code of championPoison, it avoids a potential bug.
+				if (poisonAttack > 0)
 					championMan.championPoison(champIndex, poisonAttack);
 			}
 			return damage;





More information about the Scummvm-git-logs mailing list