Ensure flawless is false if any hog is lost, unless it was lost doing a kamikaze
authornemo
Sat, 17 Mar 2012 17:18:43 -0400
changeset 6792 f72c8b5d421c
parent 6791 6907194f2c57
child 6793 d62f25f5d6ce
Ensure flawless is false if any hog is lost, unless it was lost doing a kamikaze
hedgewars/GSHandlers.inc
hedgewars/uGearsList.pas
--- a/hedgewars/GSHandlers.inc	Sat Mar 17 16:14:08 2012 -0400
+++ b/hedgewars/GSHandlers.inc	Sat Mar 17 17:18:43 2012 -0400
@@ -2905,8 +2905,8 @@
                         end
                 end;
         AfterAttack;
+        DeleteGear(HHGear);
         DeleteGear(Gear);
-        DeleteGear(HHGear);
     end
     else
         begin
--- a/hedgewars/uGearsList.pas	Sat Mar 17 16:14:08 2012 -0400
+++ b/hedgewars/uGearsList.pas	Sat Mar 17 17:18:43 2012 -0400
@@ -496,6 +496,8 @@
         end
     else*)
         begin
+        if (Gear <> CurrentHedgehog^.Gear) or (CurAmmoGear = nil) or (CurAmmoGear^.Kind <> gtKamikaze) then
+            Gear^.Hedgehog^.Team^.Clan^.Flawless:= false;
         if (hwRound(Gear^.Y) >= cWaterLine) then
             begin
             t:= max(Gear^.Damage, Gear^.Health);