fix stray offset in resurrector, make resurrector use time
authornemo
Sun, 07 Nov 2010 12:37:29 -0500
changeset 4184 bc2b88eea8c4
parent 4182 5240a84df702
child 4185 2502c381f1c3
fix stray offset in resurrector, make resurrector use time
hedgewars/GSHandlers.inc
--- a/hedgewars/GSHandlers.inc	Sun Nov 07 20:36:16 2010 +0300
+++ b/hedgewars/GSHandlers.inc	Sun Nov 07 12:37:29 2010 -0500
@@ -4199,6 +4199,9 @@
     hh: PHedgehog;
     i: LongInt;
 begin
+    if (TurnTimeLeft > 0) then
+        dec(TurnTimeLeft);
+
     AllInactive := false;
     hh := PHedgehog(Gear^.Hedgehog);
     DrawCentered(hwRound(hh^.Gear^.X) + WorldDx, hwRound(hh^.Gear^.Y) + WorldDy -
@@ -4218,8 +4221,7 @@
         if not TestCollisionYwithGear(hh^.Gear, -1) then hh^.Gear^.Y := hh^.Gear^.Y - _1;
         end;
 
-    graves := GearsNear(Gear^.X, Gear^.Y + int2hwFloat(Gear^.Power),
-                    gtGrave, Gear^.Radius);
+    graves := GearsNear(Gear^.X, Gear^.Y, gtGrave, Gear^.Radius);
 
     if Length(graves) = 0 then 
         begin
@@ -4229,7 +4231,7 @@
         exit;
         end;
 
-    if ((Gear^.Message and gmAttack) <> 0) and (hh^.Gear^.Health > 0) then 
+    if ((Gear^.Message and gmAttack) <> 0) and (hh^.Gear^.Health > 0) and (TurnTimeLeft > 0) then 
         begin
         i := getRandom(Length(graves));
         dec(hh^.Gear^.Health);