# HG changeset patch # User unc0rr # Date 1301334279 -14400 # Node ID 8de3d20b501e8317ebf55b3d6f0a19931a2cd7bb # Parent d0722d0b024dc00d8e3c0d1e3a6a09f856fc1374# Parent c90b1da271bc1925dd6ec8d667f35112066c1971 merge diff -r c90b1da271bc -r 8de3d20b501e hedgewars/GSHandlers.inc --- a/hedgewars/GSHandlers.inc Mon Mar 28 19:31:47 2011 +0200 +++ b/hedgewars/GSHandlers.inc Mon Mar 28 21:44:39 2011 +0400 @@ -219,7 +219,10 @@ //else // PlaySound(sndOw1, Gear^.Hedgehog^.Team^.voicepack); - ApplyDamage(Gear, CurrentHedgehog, dmg, dsFall); + if Gear^.LastDamage <> nil then + ApplyDamage(Gear, Gear^.LastDamage, dmg, dsFall) + else + ApplyDamage(Gear, CurrentHedgehog, dmg, dsFall); end end; diff -r c90b1da271bc -r 8de3d20b501e hedgewars/uGears.pas --- a/hedgewars/uGears.pas Mon Mar 28 19:31:47 2011 +0200 +++ b/hedgewars/uGears.pas Mon Mar 28 21:44:39 2011 +0400 @@ -578,7 +578,10 @@ // should be not CurrentHedgehog, but hedgehog of the last gear which caused damage to this hog // same stand for CheckHHDamage - uStats.HedgehogDamaged(Gear, CurrentHedgehog) + if (Gear^.LastDamage <> nil) then + uStats.HedgehogDamaged(Gear, Gear^.LastDamage) + else + uStats.HedgehogDamaged(Gear, CurrentHedgehog) end; team:= Gear^.Hedgehog^.Team; @@ -1019,6 +1022,8 @@ if (Gear^.Kind = gtHedgehog) then begin + Gear^.LastDamage := AttackerHog; + Gear^.Hedgehog^.Team^.Clan^.Flawless:= false; uStats.HedgehogDamaged(Gear, AttackerHog); HHHurt(Gear^.Hedgehog, Source); @@ -1053,6 +1058,7 @@ not CurrentHedgehog^.Gear^.Invulnerable then begin // this cannot just use Damage or it interrupts shotgun and gets you called stupid inc(CurrentHedgehog^.Gear^.Karma, tmpDmg); + CurrentHedgehog^.Gear^.LastDamage := CurrentHedgehog; spawnHealthTagForHH(CurrentHedgehog^.Gear, tmpDmg); end; end; diff -r c90b1da271bc -r 8de3d20b501e hedgewars/uTeams.pas --- a/hedgewars/uTeams.pas Mon Mar 28 19:31:47 2011 +0200 +++ b/hedgewars/uTeams.pas Mon Mar 28 21:44:39 2011 +0400 @@ -211,7 +211,8 @@ begin Z:= cCurrHHZ; State:= gstHHDriven; - Active:= true + Active:= true; + LastDamage:= nil end; RemoveGearFromList(Gear); InsertGearToList(Gear); diff -r c90b1da271bc -r 8de3d20b501e hedgewars/uTypes.pas --- a/hedgewars/uTypes.pas Mon Mar 28 19:31:47 2011 +0200 +++ b/hedgewars/uTypes.pas Mon Mar 28 21:44:39 2011 +0400 @@ -235,7 +235,8 @@ ImpactSound: TSound; // first sound, others have to be after it in the sounds def. nImpactSounds: Word; // count of ImpactSounds SoundChannel: LongInt; - PortalCounter: LongWord // Hopefully temporary, but avoids infinite portal loops in a guaranteed fashion. + PortalCounter: LongWord; // Hopefully temporary, but avoids infinite portal loops in a guaranteed fashion. + LastDamage: PHedgehog; end; TPGearArray = Array of PGear;