Call statistics routine after setting the damage
authorunc0rr
Fri, 29 Apr 2011 17:05:10 +0400
changeset 5190 9edb5ae12cfb
parent 5188 d0461bd6d45b
child 5192 881c14f81d12
Call statistics routine after setting the damage
hedgewars/uGears.pas
--- a/hedgewars/uGears.pas	Fri Apr 29 03:31:50 2011 +0200
+++ b/hedgewars/uGears.pas	Fri Apr 29 17:05:10 2011 +0400
@@ -1042,7 +1042,6 @@
     Gear^.LastDamage := AttackerHog;
 
     Gear^.Hedgehog^.Team^.Clan^.Flawless:= false;
-    uStats.HedgehogDamaged(Gear, AttackerHog);
     HHHurt(Gear^.Hedgehog, Source);
     AddDamageTag(hwRound(Gear^.X), hwRound(Gear^.Y), Damage, Gear^.Hedgehog^.Team^.Clan^.Color);
     tmpDmg:= min(Damage, max(0,Gear^.Health-Gear^.Damage));
@@ -1084,6 +1083,8 @@
         Gear^.Hedgehog:= AttackerHog;
         end;
     inc(Gear^.Damage, Damage);
+    
+    uStats.HedgehogDamaged(Gear, AttackerHog);    
     ScriptCall('onGearDamage', Gear^.UID, Damage);
 end;