hedgewars/uGearsUtils.pas
changeset 15147 5dc3e3f1c0f9
parent 15146 6b7d92fa4912
child 15150 c383ebdd61b9
equal deleted inserted replaced
15146:6b7d92fa4912 15147:5dc3e3f1c0f9
  1760         WorldWrap:= true;
  1760         WorldWrap:= true;
  1761         end
  1761         end
  1762     else if WorldEdge = weBounce then
  1762     else if WorldEdge = weBounce then
  1763         begin
  1763         begin
  1764         bounced:= false;
  1764         bounced:= false;
  1765         if (hwRound(Gear^.X) - Gear^.Radius < leftX) and (hwSign(Gear^.dX) = -1) and (not isZero(Gear^.dX)) then
  1765         if (hwRound(Gear^.X) - Gear^.Radius < leftX) and (Gear^.Kind = gtHedgehog) or ((hwSign(Gear^.dX) = -1) and (not isZero(Gear^.dX))) then
  1766             begin
  1766             begin
  1767             LeftImpactTimer:= 333;
  1767             LeftImpactTimer:= 333;
  1768             Gear^.dX.isNegative:= false;
  1768             Gear^.dX.isNegative:= false;
  1769             Gear^.X:= int2hwfloat(leftX + Gear^.Radius);
  1769             Gear^.X:= int2hwfloat(leftX + Gear^.Radius);
  1770             bounced:= true;
  1770             bounced:= true;
  1771             end
  1771             end
  1772         else if (hwRound(Gear^.X) - Gear^.Radius > rightX) and (hwSign(Gear^.dX) = 1) and (not isZero(Gear^.dX)) then
  1772         else if (hwRound(Gear^.X) - Gear^.Radius > rightX) and (Gear^.Kind = gtHedgehog) or ((hwSign(Gear^.dX) = 1) and (not isZero(Gear^.dX))) then
  1773             begin
  1773             begin
  1774             RightImpactTimer:= 333;
  1774             RightImpactTimer:= 333;
  1775             Gear^.dX.isNegative:= true;
  1775             Gear^.dX.isNegative:= true;
  1776             Gear^.X:= int2hwfloat(rightX-Gear^.Radius);
  1776             Gear^.X:= int2hwfloat(rightX-Gear^.Radius);
  1777             bounced:= true;
  1777             bounced:= true;