hedgewars/uGears.pas
changeset 4826 d6a0a38407c8
parent 4824 efbc8f80acac
child 4830 c5ddc3e6c8a4
--- a/hedgewars/uGears.pas	Sun Jan 09 21:36:51 2011 +0300
+++ b/hedgewars/uGears.pas	Sun Jan 09 21:37:45 2011 +0300
@@ -558,6 +558,8 @@
             Gear^.Damage:= t;
             if ((not SuddenDeathDmg and (cWaterOpacity < $FF)) or (SuddenDeathDmg and (cWaterOpacity < $FF))) and (hwRound(Gear^.Y) < cWaterLine + 256) then
                 spawnHealthTagForHH(Gear, t);
+
+            // should be CurrentHedgehog, but hedgehog of the last gear which caused damage to this hog
             uStats.HedgehogDamaged(Gear, CurrentHedgehog^.Gear)
             end;
 
@@ -1028,7 +1030,8 @@
            spawnHealthTagForHH(CurrentHedgehog^.Gear, tmpDmg);
            end;
         end;
-    end;
+    end else // not gtHedgehog
+        Gear^.Hedgehog:= Attacker^.Hedgehog;
     inc(Gear^.Damage, Damage);
     ScriptCall('onGearDamage', Gear^.UID, Damage);
 end;