- Use LastDamage in CheckHHDamage
- Clear hedgehog's LastDamage when switching to him
--- a/hedgewars/GSHandlers.inc Mon Mar 28 21:27:06 2011 +0400
+++ b/hedgewars/GSHandlers.inc Mon Mar 28 21:44:17 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;
--- a/hedgewars/uGears.pas Mon Mar 28 21:27:06 2011 +0400
+++ b/hedgewars/uGears.pas Mon Mar 28 21:44:17 2011 +0400
@@ -1022,7 +1022,6 @@
if (Gear^.Kind = gtHedgehog) then
begin
-
Gear^.LastDamage := AttackerHog;
Gear^.Hedgehog^.Team^.Clan^.Flawless:= false;
--- a/hedgewars/uTeams.pas Mon Mar 28 21:27:06 2011 +0400
+++ b/hedgewars/uTeams.pas Mon Mar 28 21:44:17 2011 +0400
@@ -211,7 +211,8 @@
begin
Z:= cCurrHHZ;
State:= gstHHDriven;
- Active:= true
+ Active:= true;
+ LastDamage:= nil
end;
RemoveGearFromList(Gear);
InsertGearToList(Gear);