Make frozen hogs poison immune
authornemo
Mon, 03 Oct 2016 14:10:25 -0400
changeset 11872 f6d33710baff
parent 11871 afa8182003cc
child 11873 60c8bb8bc1d7
Make frozen hogs poison immune
hedgewars/uGears.pas
hedgewars/uGearsUtils.pas
--- a/hedgewars/uGears.pas	Sun Oct 02 18:30:15 2016 +0200
+++ b/hedgewars/uGears.pas	Mon Oct 03 14:10:25 2016 -0400
@@ -125,7 +125,7 @@
         if Gear^.Kind = gtHedgehog then
             begin
             tmp:= 0;
-            if Gear^.Hedgehog^.Effects[hePoisoned] <> 0 then
+            if (Gear^.Hedgehog^.Effects[hePoisoned] <> 0) and (Gear^.Hedgehog^.Effects[heFrozen] = 0) then
                 begin
                 inc(tmp, ModifyDamage(Gear^.Hedgehog^.Effects[hePoisoned], Gear));
                 if (GameFlags and gfResetHealth) <> 0 then
--- a/hedgewars/uGearsUtils.pas	Sun Oct 02 18:30:15 2016 +0200
+++ b/hedgewars/uGearsUtils.pas	Mon Oct 03 14:10:25 2016 -0400
@@ -175,7 +175,9 @@
                                 Gear^.Active:= true;
                                 if Gear^.Kind <> gtFlame then FollowGear:= Gear
                                 end;
-                            if ((Mask and EXPLPoisoned) <> 0) and (Gear^.Kind = gtHedgehog) and (Gear^.Hedgehog^.Effects[heInvulnerable] = 0) and (Gear^.State and gstHHDeath = 0) then
+                            if ((Mask and EXPLPoisoned) <> 0) and (Gear^.Kind = gtHedgehog) and
+                                (Gear^.Hedgehog^.Effects[heInvulnerable] = 0) and (Gear^.Hedgehog^.Effects[heFrozen] = 0) and
+                                (Gear^.State and gstHHDeath = 0) then
                                 Gear^.Hedgehog^.Effects[hePoisoned] := 5;
                             end;