hedgewars/GSHandlers.inc
changeset 8730 b39f433f8ab4
parent 8727 43b1487f02f6
child 8744 6c87486fd89b
--- a/hedgewars/GSHandlers.inc	Tue Mar 12 22:35:57 2013 -0400
+++ b/hedgewars/GSHandlers.inc	Wed Mar 13 21:02:26 2013 -0400
@@ -4732,6 +4732,7 @@
 procedure doStepResurrector(Gear: PGear);
 var
     graves: PGearArrayS;
+    hh: PHedgehog;
     i: LongInt;
 begin
     AllInactive := false;
@@ -4739,12 +4740,24 @@
 
     if graves.size > 0 then
         begin
+        hh := Gear^.Hedgehog;
         for i:= 0 to graves.size - 1 do
             begin
             PHedgehog(graves.ar^[i]^.Hedgehog)^.Gear := nil;
             graves.ar^[i]^.Health := 0;
             end;
         Gear^.doStep := @doStepResurrectorWork;
+        if ((Gear^.Message and gmAttack) <> 0) and (hh^.Gear^.Health > 0) and (TurnTimeLeft > 0) then
+            begin
+            if LongInt(graves.size) <= Gear^.Tag then Gear^.Tag:= 0;
+            dec(hh^.Gear^.Health);
+            if (hh^.Gear^.Health = 0) and (hh^.Gear^.Damage = 0) then
+                hh^.Gear^.Damage:= 1;
+            RenderHealth(hh^);
+            RecountTeamHealth(hh^.Team);
+            inc(graves.ar^[Gear^.Tag]^.Health);
+            inc(Gear^.Tag)
+            end 
         end 
     else 
         begin