# HG changeset patch # User unc0rr # Date 1294598265 -10800 # Node ID d6a0a38407c8ada3e0f6eff1c8d4fcae7a409a44 # Parent e8539e429ae37475d92ee7e97e0198e35f8569e3 Inherit hedgehog from gear which caused damage, thus keeping track of which hog actually did the damage diff -r e8539e429ae3 -r d6a0a38407c8 hedgewars/uGears.pas --- 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;