hedgewars/GSHandlers.inc
changeset 345 fa39c61be4de
parent 344 a98ade8c99b6
child 346 fc1e0a4f152c
--- a/hedgewars/GSHandlers.inc	Mon Jan 15 23:25:44 2007 +0000
+++ b/hedgewars/GSHandlers.inc	Tue Jan 16 16:51:12 2007 +0000
@@ -523,19 +523,11 @@
    end;
 Gear.dX:= HHGear.X - Gear.X;
 Gear.dY:= HHGear.Y - Gear.Y;
-if (GameTicks > 189200)and(GameTicks < 189300) then AddFileLog('Rope 1: (' + floattostr(HHGear.X) + ',' + floattostr(HHGear.Y) + ')');
-if (GameTicks > 189200)and(GameTicks < 189300) 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;
 
-if not TestCollisionYwithGear(HHGear, 1) then
-   begin
-   HHGear.dY:= HHGear.dY + cGravity;
-   if (GameTicks > 189200)and(GameTicks < 189300) then AddFileLog('Rope 4: free fall');
-   end;
-
-if (GameTicks > 189200)and(GameTicks < 189300) then AddFileLog('Rope 3: ' + floattostr(HHGear.dY));
+if not TestCollisionYwithGear(HHGear, 1) then HHGear.dY:= HHGear.dY + cGravity;
 
 cs:= Gear.dY + HHGear.dY;
 cc:= Gear.dX + HHGear.dX;
@@ -543,8 +535,6 @@
 cc:= cc * len;
 cs:= cs * len;
 
-if (GameTicks > 189200)and(GameTicks < 189300) then AddFileLog('Rope 5: (' + floattostr(cc) + ',' + floattostr(cs) + ')');
-
 flCheck:= not flCheck;
 if flCheck then  // check whether rope needs dividing
    begin
@@ -555,17 +545,14 @@
          ty:= cs*len;
          lx:= round(Gear.X + tx) + hwSign(HHGear.dX);
          ly:= round(Gear.Y + ty) + hwSign(HHGear.dY);
-         if (GameTicks > 189200)and(GameTicks < 189300) 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 < 189300) then AddFileLog('Rope b: !!');
            with RopePoints.ar[RopePoints.Count] do
                 begin
                 X:= Gear.X;
                 Y:= Gear.Y;
                 if RopePoints.Count = 0 then RopePoints.HookAngle:= DxDy2Angle32(Gear.dY, Gear.dX);
                 b:= (cc * HHGear.dY) > (cs * HHGear.dX);
-                AddFileLog('Rope: b = ' + inttostr(ord(b)));
                 dLen:= len
                 end;
            Gear.X:= Gear.X + tx;
@@ -582,8 +569,6 @@
       begin
       tx:= RopePoints.ar[Pred(RopePoints.Count)].X;
       ty:= RopePoints.ar[Pred(RopePoints.Count)].Y;
-      if (GameTicks > 189200)and(GameTicks < 189300) then AddFileLog('Rope a: (' + floattostr(tx) + ',' + floattostr(ty) + ')');
-      if GameTicks = 189245 then AddFileLog('Rope A: ' + inttostr(ord((tx - Gear.X) * (ty - HHGear.Y) > (tx - HHGear.X) * (ty - Gear.Y))));
       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);
@@ -597,8 +582,6 @@
 Gear.dX:= HHGear.X - Gear.X;
 Gear.dY:= HHGear.Y - Gear.Y;
 
-if (GameTicks > 189200)and(GameTicks < 189300) then AddFileLog('Rope 6: (' + floattostr(Gear.dX) + ',' + floattostr(Gear.dY) + ')');
-
 cs:= Gear.dY + HHGear.dY;
 cc:= Gear.dX + HHGear.dX;
 len:= 1 / sqrt(sqr(cc)+sqr(cs));
@@ -622,16 +605,11 @@
 HHGear.dX:= HHGear.X - HHGear.dX;
 HHGear.dY:= HHGear.Y - HHGear.dY;
 
-if (GameTicks > 189200)and(GameTicks < 189300) then AddFileLog('Rope 7: (' + floattostr(HHGear.dX) + ',' + floattostr(HHGear.dY) + ')');
-if (GameTicks > 189200)and(GameTicks < 189300) 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;
 
-if (GameTicks > 189200)and(GameTicks < 189300) 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
 else if (Gear.State and gsttmpFlag) = 0 then Gear.State:= Gear.State or gsttmpFlag;