From 2a080979b8d0002a35edd0750de74b2dd4c05dea Mon Sep 17 00:00:00 2001 From: Strangerke Date: Sun, 30 Oct 2016 08:05:41 -0700 Subject: DM: Fix GCC warning (and potential bug) --- engines/dm/group.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'engines/dm') 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; -- cgit v1.2.3