hedgewars/GSHandlers.inc
changeset 3975 3f605cca9215
parent 3971 5c82ee165ed5
child 3976 abaf741a4e21
--- a/hedgewars/GSHandlers.inc	Wed Oct 13 00:57:20 2010 +0200
+++ b/hedgewars/GSHandlers.inc	Thu Oct 14 16:01:43 2010 +0200
@@ -4100,6 +4100,8 @@
     DrawCircle(hwRound(Gear^.X), hwRound(Gear^.Y), Gear^.Radius, 1.5, 0, 0, $FF,
             $FF);
 
+    doStepHedgehogMoving(hh^.Gear);
+
     if ((Gear^.Message and gmUp) <> 0) then begin
         if (GameTicks and $F) <> 0 then exit;
     end else begin
@@ -4108,9 +4110,14 @@
 
     graves := GearsNear(hh^.Gear, gtGrave, Gear^.Radius);
 
+    if Length(graves) = 0 then begin
+        Gear^.Timer := 250;
+        Gear^.doStep := @doStepIdle;
+        exit;
+    end;
+
     if ((Gear^.Message and gmAttack) <> 0) and (hh^.Gear^.Health > 0) then begin
         i := getRandom(Length(graves));
-        writeln(i);
         dec(hh^.Gear^.Health);
         inc(graves[i]^.Health);
 {-for i:= 0 to High(graves) do begin