aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStrangerke2016-10-30 08:05:41 -0700
committerStrangerke2016-10-30 12:38:32 -0700
commit2a080979b8d0002a35edd0750de74b2dd4c05dea (patch)
tree0f49486d978911ccc9428da21c5cfc39933a1fd7
parent3a98d950b07b4c778f28648804455a661966e782 (diff)
downloadscummvm-rg350-2a080979b8d0002a35edd0750de74b2dd4c05dea.tar.gz
scummvm-rg350-2a080979b8d0002a35edd0750de74b2dd4c05dea.tar.bz2
scummvm-rg350-2a080979b8d0002a35edd0750de74b2dd4c05dea.zip
DM: Fix GCC warning (and potential bug)
-rw-r--r--engines/dm/group.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/engines/dm/group.cpp b/engines/dm/group.cpp
index cf748ffa41..a72342da3d 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;