tweak splash position
authorsheepluva
Wed, 01 Oct 2014 22:46:58 +0200
changeset 10417 8f66bb4dbf80
parent 10415 fb80f6b1327f
child 10419 e19a864e2fab
tweak splash position
hedgewars/uGearsUtils.pas
--- a/hedgewars/uGearsUtils.pas	Wed Oct 01 15:51:17 2014 -0400
+++ b/hedgewars/uGearsUtils.pas	Wed Oct 01 22:46:58 2014 +0200
@@ -364,6 +364,7 @@
     speed, hwTmp: hwFloat;
     vi, vs, tmp: real; // impact speed and sideways speed
     isImpactH, isImpactRight: boolean;
+const dist2surf = 6;
 begin
 x:= hwRound(Gear^.X);
 y:= hwRound(Gear^.Y);
@@ -389,7 +390,7 @@
 
 if not isImpactH then
     begin
-    dec(y, distB);
+    y:= cWaterline - dist2surf;
     splash^.Y:= y;
     speed:= hwAbs(Gear^.dY);
     vs:= abs(hwFloat2Float(Gear^.dX));
@@ -399,12 +400,12 @@
     isImpactRight := minDist = distR;
     if isImpactRight then
         begin
-        inc(x, distR);
+        x := rightX - dist2surf;;
         splash^.Angle:= -90;
         end
     else
         begin
-        dec(x, distL);
+        x := leftX + dist2surf;;
         splash^.Angle:=  90;
         end;
     splash^.X:= x;