Fix ApplyDamage accepting Damage == 0
authorunc0rr
Sun, 30 Jan 2011 21:33:08 +0300
changeset 4885 bf7f2c1cc235
parent 4884 b2006a9f0fbc
child 4887 39f300fdbc64
Fix ApplyDamage accepting Damage == 0
hedgewars/uGears.pas
--- a/hedgewars/uGears.pas	Sun Jan 30 06:56:12 2011 +0100
+++ b/hedgewars/uGears.pas	Sun Jan 30 21:33:08 2011 +0300
@@ -1004,7 +1004,9 @@
     vampDmg, tmpDmg, i: Longword;
     vg: PVisualGear;
 begin
-    if (Gear^.Kind = gtHedgehog) and (Damage>=1) then
+  if Damage = 0 then exit; // nothing to apply
+
+    if (Gear^.Kind = gtHedgehog) then
     begin
     uStats.HedgehogDamaged(Gear, AttackerHog);
     HHHurt(Gear^.Hedgehog, Source);