# HG changeset patch # User nemo # Date 1420134180 18000 # Node ID 5b7cf9fcb47eaf3327bf7d5e3f1e4b62de144484 # Parent 8fadc4305df0c1bd3613290da4a3d831489ab63a Try to handle negative gravity w/ snow. Still needs to look nicer. Currently causes banding. diff -r 8fadc4305df0 -r 5b7cf9fcb47e hedgewars/uGearsHandlersMess.pas --- a/hedgewars/uGearsHandlersMess.pas Tue Dec 30 23:31:00 2014 +0300 +++ b/hedgewars/uGearsHandlersMess.pas Thu Jan 01 12:43:00 2015 -0500 @@ -804,6 +804,8 @@ move:= true else if (xx > snowRight) or (xx < snowLeft) then move:=true + else if (cGravity < _0) and (yy < LAND_HEIGHT-1200) then + move:=true // Solid pixel encountered else if ((yy and LAND_HEIGHT_MASK) = 0) and ((xx and LAND_WIDTH_MASK) = 0) and (Land[yy, xx] <> 0) then begin @@ -920,7 +922,9 @@ end; Gear^.Pos:= 0; Gear^.X:= int2hwFloat(LongInt(GetRandom(snowRight - snowLeft)) + snowLeft); - Gear^.Y:= int2hwFloat(LAND_HEIGHT + LongInt(GetRandom(50)) - 1325); + if (cGravity < _0) and (yy < LAND_HEIGHT-1200) then + Gear^.Y:= int2hwFloat(LAND_HEIGHT - 50 - LongInt(GetRandom(50))) + else Gear^.Y:= int2hwFloat(LAND_HEIGHT + LongInt(GetRandom(50)) - 1250); Gear^.State:= Gear^.State or gstInvisible; end end;