More detailed debug
authorunc0rr
Mon, 15 Jan 2007 23:03:20 +0000
changeset 343 8a91d153f787
parent 342 0a21586b3f1d
child 344 a98ade8c99b6
More detailed debug
hedgewars/GSHandlers.inc
--- a/hedgewars/GSHandlers.inc	Mon Jan 15 22:33:40 2007 +0000
+++ b/hedgewars/GSHandlers.inc	Mon Jan 15 23:03:20 2007 +0000
@@ -523,8 +523,8 @@
    end;
 Gear.dX:= HHGear.X - Gear.X;
 Gear.dY:= HHGear.Y - Gear.Y;
-AddFileLog('Rope 1: (' + floattostr(HHGear.X) + ',' + floattostr(HHGear.Y) + ')');
-AddFileLog('Rope 2: (' + floattostr(Gear.dX) + ',' + floattostr(Gear.dY) + ')');
+if (GameTicks > 189200)and(GameTicks < 189500) then AddFileLog('Rope 1: (' + floattostr(HHGear.X) + ',' + floattostr(HHGear.Y) + ')');
+if (GameTicks > 189200)and(GameTicks < 189500) then AddFileLog('Rope 2: (' + floattostr(Gear.dX) + ',' + floattostr(Gear.dY) + ')');
 
 if (Gear.Message and gm_Left  <> 0) then HHGear.dX:= HHGear.dX - 0.0002 else
 if (Gear.Message and gm_Right <> 0) then HHGear.dX:= HHGear.dX + 0.0002;
@@ -532,10 +532,10 @@
 if not TestCollisionYwithGear(HHGear, 1) then
    begin
    HHGear.dY:= HHGear.dY + cGravity;
-   AddFileLog('Rope 4: free fall');
+   if (GameTicks > 189200)and(GameTicks < 189500) then AddFileLog('Rope 4: free fall');
    end;
 
-AddFileLog('Rope 3: ' + floattostr(HHGear.dY));
+if (GameTicks > 189200)and(GameTicks < 189500) then AddFileLog('Rope 3: ' + floattostr(HHGear.dY));
 
 cs:= Gear.dY + HHGear.dY;
 cc:= Gear.dX + HHGear.dX;
@@ -543,7 +543,7 @@
 cc:= cc * len;
 cs:= cs * len;
 
-AddFileLog('Rope 5: (' + floattostr(cc) + ',' + floattostr(cs) + ')');
+if (GameTicks > 189200)and(GameTicks < 189500) then AddFileLog('Rope 5: (' + floattostr(cc) + ',' + floattostr(cs) + ')');
 
 flCheck:= not flCheck;
 if flCheck then  // check whether rope needs dividing
@@ -555,8 +555,10 @@
          ty:= cs*len;
          lx:= round(Gear.X + tx) + hwSign(HHGear.dX);
          ly:= round(Gear.Y + ty) + hwSign(HHGear.dY);
+         if (GameTicks > 189200)and(GameTicks < 189500) then AddFileLog('Rope b: (' + inttostr(lx) + ',' + inttostr(ly) + ')');
          if ((ly and $FFFFFC00) = 0) and ((lx and $FFFFF800) = 0)and (Land[ly, lx] <> 0) then
            begin
+           if (GameTicks > 189200)and(GameTicks < 189500) then AddFileLog('Rope b: !!');
            with RopePoints.ar[RopePoints.Count] do
                 begin
                 X:= Gear.X;
@@ -579,6 +581,7 @@
       begin
       tx:= RopePoints.ar[Pred(RopePoints.Count)].X;
       ty:= RopePoints.ar[Pred(RopePoints.Count)].Y;
+      if (GameTicks > 189200)and(GameTicks < 189500) then AddFileLog('Rope a: (' + floattostr(tx) + ',' + floattostr(ty) + ')');
       if RopePoints.ar[Pred(RopePoints.Count)].b xor ((tx - Gear.X) * (ty - HHGear.Y) > (tx - HHGear.X) * (ty - Gear.Y)) then
          begin
          dec(RopePoints.Count);
@@ -592,7 +595,7 @@
 Gear.dX:= HHGear.X - Gear.X;
 Gear.dY:= HHGear.Y - Gear.Y;
 
-AddFileLog('Rope 6: (' + floattostr(Gear.dX) + ',' + floattostr(Gear.dY) + ')');
+if (GameTicks > 189200)and(GameTicks < 189500) then AddFileLog('Rope 6: (' + floattostr(Gear.dX) + ',' + floattostr(Gear.dY) + ')');
 
 cs:= Gear.dY + HHGear.dY;
 cc:= Gear.dX + HHGear.dX;
@@ -617,15 +620,15 @@
 HHGear.dX:= HHGear.X - HHGear.dX;
 HHGear.dY:= HHGear.Y - HHGear.dY;
 
-AddFileLog('Rope 7: (' + floattostr(HHGear.dX) + ',' + floattostr(HHGear.dY) + ')');
-AddFileLog('Rope 8: (' + floattostr(HHGear.X) + ',' + floattostr(HHGear.Y) + ')');
+if (GameTicks > 189200)and(GameTicks < 189500) then AddFileLog('Rope 7: (' + floattostr(HHGear.dX) + ',' + floattostr(HHGear.dY) + ')');
+if (GameTicks > 189200)and(GameTicks < 189500) then AddFileLog('Rope 8: (' + floattostr(HHGear.X) + ',' + floattostr(HHGear.Y) + ')');
 
 if TestCollisionXwithGear(HHGear, hwSign(HHGear.dX)) then
    HHGear.dX:= -0.6 * HHGear.dX;
 if TestCollisionYwithGear(HHGear, hwSign(HHGear.dY)) then
    HHGear.dY:= -0.6 * HHGear.dY;
 
-AddFileLog('Rope 9: (' + floattostr(HHGear.dX) + ',' + floattostr(HHGear.dY) + ')');
+if (GameTicks > 189200)and(GameTicks < 189500) then AddFileLog('Rope 9: (' + floattostr(HHGear.dX) + ',' + floattostr(HHGear.dY) + ')');
 
 if (Gear.Message and gm_Attack) <> 0 then
    if (Gear.State and gsttmpFlag) <> 0 then DeleteMe else