# HG changeset patch # User Wuzzy # Date 1562804707 -7200 # Node ID ebbc2f04b86389d758d3284d3d57efe52e469acf # Parent f16376e9374f9f0491151e916e7ccbdd7d2199d3 Make flames collide with bounce world edge again, properly this time diff -r f16376e9374f -r ebbc2f04b863 hedgewars/uGearsHandlersMess.pas --- a/hedgewars/uGearsHandlersMess.pas Thu Jul 11 00:53:29 2019 +0200 +++ b/hedgewars/uGearsHandlersMess.pas Thu Jul 11 02:25:07 2019 +0200 @@ -2711,9 +2711,7 @@ tdX,tdY, f: HWFloat; landPixel: Word; begin - // don't bounce - if WorldEdge <> weBounce then - WorldWrap(Gear); + WorldWrap(Gear); if Gear^.FlightTime > 0 then dec(Gear^.FlightTime); // There are 2 flame types: normal and sticky sticky:= (Gear^.State and gsttmpFlag) <> 0; @@ -2773,7 +2771,18 @@ if Gear^.dY.QWordValue > _0_2.QWordValue then Gear^.dY := Gear^.dY * _0_995; - Gear^.X := Gear^.X + Gear^.dX + cWindSpeed * 640; + // Apply speed changes + + tdX:= Gear^.dX + cWindSpeed * 640; + // Don't apply wind speed if moving against bounce world edge + if (WorldEdge = weBounce) and + (((hwRound(Gear^.X + tdX) - Gear^.Radius < leftX) and (hwSign(tdX) = -1)) or + ((hwRound(Gear^.X + tdX) + Gear^.Radius > rightX) and (hwSign(tdX) = 1))) then + Gear^.X := Gear^.X + Gear^.dX + else + // Apply dX and wind speed + Gear^.X := Gear^.X + tdX; + Gear^.Y := Gear^.Y + Gear^.dY; end; diff -r f16376e9374f -r ebbc2f04b863 hedgewars/uGearsList.pas --- a/hedgewars/uGearsList.pas Thu Jul 11 00:53:29 2019 +0200 +++ b/hedgewars/uGearsList.pas Thu Jul 11 02:25:07 2019 +0200 @@ -225,6 +225,7 @@ case gear^.Kind of // list all gears here that could collide with the bounce world edge gtHedgehog, + gtFlame, gtMine, gtAirBomb, gtDrill,