hedgewars/uGearsHandlers.pas
changeset 13619 c9642782778b
parent 13612 212036414957
child 14287 6015b74eea55
equal deleted inserted replaced
13618:d6b79a080a3e 13619:c9642782778b
    95                 end
    95                 end
    96             end;
    96             end;
    97 
    97 
    98     // Handle world wrap and bounce edge manually
    98     // Handle world wrap and bounce edge manually
    99     if (WorldEdge = weWrap) and
    99     if (WorldEdge = weWrap) and
   100         ((hwRound(Gear^.X) <= LongInt(leftX)) or (hwRound(Gear^.X) >= LongInt(rightX))) then
   100         ((hwRound(Gear^.X) < LongInt(leftX)) or (hwRound(Gear^.X) > LongInt(rightX))) then
   101         begin
   101         begin
   102         LeftImpactTimer:= 150;
   102         LeftImpactTimer:= 150;
   103         RightImpactTimer:= 150;
   103         RightImpactTimer:= 150;
   104         Gear^.WDTimer:= 4;
   104         Gear^.WDTimer:= 0;
   105         Gear^.Karma:= 2;
   105         Gear^.Karma:= 1;
   106         end
   106         end
   107     else if (WorldEdge = weBounce) and
   107     else if (WorldEdge = weBounce) and
   108         (((hwRound(Gear^.X) - Gear^.Radius) < LongInt(leftX)) or ((hwRound(Gear^.X) + Gear^.Radius) > LongInt(rightX))) then
   108         (((hwRound(Gear^.X) - Gear^.Radius) < LongInt(leftX)) or ((hwRound(Gear^.X) + Gear^.Radius) > LongInt(rightX))) then
   109         begin
   109         begin
   110         if (hwRound(Gear^.X) - Gear^.Radius < LongInt(leftX)) then
   110         if (hwRound(Gear^.X) - Gear^.Radius < LongInt(leftX)) then
   111             LeftImpactTimer:= 333
   111             LeftImpactTimer:= 333
   112         else
   112         else
   113             RightImpactTimer:= 333;
   113             RightImpactTimer:= 333;
   114         Gear^.Karma:= 1;
   114         Gear^.Karma:= 2;
   115         Gear^.WDTimer:= 0;
   115         Gear^.WDTimer:= 0;
   116         if (Gear^.Radius > 2) and (Gear^.dX.QWordValue > _0_001.QWordValue) then
   116         if (Gear^.Radius > 2) and (Gear^.dX.QWordValue > _0_001.QWordValue) then
   117             AddBounceEffectForGear(Gear);
   117             AddBounceEffectForGear(Gear);
   118         end;
   118         end;
   119 
   119