Should never use State like this, since some states aren't synced (thinking state for example)
authorunc0rr
Wed, 19 Feb 2014 19:10:11 +0400
changeset 10146 1fb6d8cc4626
parent 10145 67b255f839db
child 10147 9a772dc5dfbe
Should never use State like this, since some states aren't synced (thinking state for example)
hedgewars/uGearsHedgehog.pas
--- a/hedgewars/uGearsHedgehog.pas	Tue Feb 18 06:02:22 2014 +0100
+++ b/hedgewars/uGearsHedgehog.pas	Wed Feb 19 19:10:11 2014 +0400
@@ -948,7 +948,7 @@
         end
     end;
 
-if (Gear^.State <> 0) then
+if (Gear^.State and (gstMoving or gstHHJumping or gstHHHJump)) <> 0 then
     DeleteCI(Gear);
 
 if isUnderwater then
@@ -1346,6 +1346,7 @@
 procedure doStepHedgehog(Gear: PGear);
 var tX: hwFloat;
 begin
+AddFileLog('[HOG] -#' + inttostr(Gear^.uid) + ': ' + floattostr(Gear^.X) + ', ' + floattostr(Gear^.Y) + ' (' + floattostr(Gear^.dX) + ', ' + floattostr(Gear^.dY) + ')');
 CheckGearDrowning(Gear);
 if Gear = nil then exit;
 tX:= Gear^.X;
@@ -1389,6 +1390,7 @@
         else
             doStepHedgehogDriven(Gear)
     end;
+AddFileLog('[HOG] +#' + inttostr(Gear^.uid) + ': ' + floattostr(Gear^.X) + ', ' + floattostr(Gear^.Y) + ' (' + floattostr(Gear^.dX) + ', ' + floattostr(Gear^.dY) + ')');
 end;
 
 end.