# HG changeset patch # User Wuzzy # Date 1547432601 -3600 # Node ID 1d3dc553829c992cb238029edf1b875e1fc6cc9c # Parent 0da43a3d5500af0cfdf4570482b5ee2bd7303671 Fix WorldWrap returning sometimes true unjustifiably diff -r 0da43a3d5500 -r 1d3dc553829c hedgewars/uGearsUtils.pas --- a/hedgewars/uGearsUtils.pas Mon Jan 14 02:48:36 2019 +0100 +++ b/hedgewars/uGearsUtils.pas Mon Jan 14 03:23:21 2019 +0100 @@ -1759,7 +1759,8 @@ Gear^.X:= Gear^.X + int2hwfloat(rightX - leftX) else Gear^.X:= Gear^.X - int2hwfloat(rightX - leftX); LeftImpactTimer:= 150; - RightImpactTimer:= 150 + RightImpactTimer:= 150; + WorldWrap:= true; end else if WorldEdge = weBounce then begin @@ -1778,10 +1779,16 @@ Gear^.X:= int2hwfloat(rightX-Gear^.Radius); bounced:= true; end; - if (bounced) and (Gear^.Radius > 2) and (Gear^.dX.QWordValue > _0_001.QWordValue) then - AddBounceEffectForGear(Gear); - end{ - else if WorldEdge = weSea then + if (bounced) then + begin + WorldWrap:= true; + if (Gear^.Radius > 2) and (Gear^.dX.QWordValue > _0_001.QWordValue) then + AddBounceEffectForGear(Gear); + end; + end + else + WorldWrap:= true; +{ else if WorldEdge = weSea then begin if (hwRound(Gear^.Y) > cWaterLine) and (Gear^.State and gstSubmersible <> 0) then Gear^.State:= Gear^.State and (not gstSubmersible) @@ -1795,8 +1802,10 @@ Gear^.dY:= tdx; Gear^.dY.isNegative:= true end - end}; -(* + end; + +--- + * Window in the sky (Gear moved high into the sky, Y is used to determine X) [unfortunately, not a safe thing to do. shame, I thought aerial bombardment would be kinda neat This one would be really easy to freeze game unless it was flagged unfortunately. @@ -1809,8 +1818,7 @@ Gear^.dY:= tdx; Gear^.dY.isNegative:= false end -*) - WorldWrap:= true +} end; end;