Delete vgtDroplet and vgtChunk when hitting the ocean world edge
authorWuzzy <Wuzzy2@mail.ru>
Thu, 11 Jul 2019 23:53:30 +0200
changeset 15259 df5890e5a12a
parent 15258 5c91c5191085
child 15260 de53425ebc39
Delete vgtDroplet and vgtChunk when hitting the ocean world edge
hedgewars/uVisualGearsHandlers.pas
--- a/hedgewars/uVisualGearsHandlers.pas	Thu Jul 11 22:31:29 2019 +0200
+++ b/hedgewars/uVisualGearsHandlers.pas	Thu Jul 11 23:53:30 2019 +0200
@@ -470,7 +470,7 @@
 Gear^.Y:= Gear^.Y + Gear^.dY * Steps;
 Gear^.dY:= Gear^.dY + cGravityf * Steps;
 
-if round(Gear^.Y) > cWaterLine then
+if CheckCoordInWater(round(Gear^.X), round(Gear^.Y)) then
     begin
     DeleteVisualGear(Gear);
     PlaySound(TSound(ord(sndDroplet1) + Random(3)));
@@ -848,7 +848,7 @@
 
 Gear^.Angle:= round(Gear^.Angle + Steps) mod cMaxAngle;
 
-if (round(Gear^.Y) > cWaterLine) and ((cReducedQuality and rqPlainSplash) = 0) then
+if ((cReducedQuality and rqPlainSplash) = 0) and (CheckCoordInWater(round(Gear^.X), round(Gear^.Y))) then
     begin
     AddVisualGear(round(Gear^.X), round(Gear^.Y), vgtDroplet);
     DeleteVisualGear(Gear);