# HG changeset patch
# User KoBeWi <kobewi4e@gmail.com>
# Date 1491664882 -7200
# Node ID 4d818abdc00f501256bc568eb3f2c6151477f5b9
# Parent  31184d9b9bfc01cfddbc484168a25e68908b10ed
Fix bad water flow animation

diff -r 31184d9b9bfc -r 4d818abdc00f hedgewars/uLandObjects.pas
--- a/hedgewars/uLandObjects.pas	Sat Apr 08 17:17:28 2017 +0200
+++ b/hedgewars/uLandObjects.pas	Sat Apr 08 17:21:22 2017 +0200
@@ -777,7 +777,7 @@
         i:= Pos(',', s);
         watFrameTicks:= StrToInt(Trim(Copy(s, 1, Pred(i))));
         Delete(s, 1, i);
-        watMove:= StrToInt(Trim(Copy(s, 1, Pred(i))));
+        watMove:= StrToInt(Trim(s));
         end
     else if key = 'sd-water-animation' then
         begin
@@ -787,7 +787,7 @@
         i:= Pos(',', s);
         watSDFrameTicks:= StrToInt(Trim(Copy(s, 1, Pred(i))));
         Delete(s, 1, i);
-        watSDMove:= StrToInt(Trim(Copy(s, 1, Pred(i))));
+        watSDMove:= StrToInt(Trim(s));
         end
     else if key = 'flakes' then
         begin
diff -r 31184d9b9bfc -r 4d818abdc00f hedgewars/uRender.pas
--- a/hedgewars/uRender.pas	Sat Apr 08 17:17:28 2017 +0200
+++ b/hedgewars/uRender.pas	Sat Apr 08 17:21:22 2017 +0200
@@ -1873,7 +1873,7 @@
 else
 	frame:= 0;
 
-TextureBuffer[3].X:= shift + ((LongInt(RealTicks shr (16 - waterSpeed)) * Dir + dX) mod spriteWidth) / (spriteWidth - 1);
+TextureBuffer[3].X:= shift + ((LongInt((RealTicks * waterSpeed) shr 6) * Dir + dX) mod spriteWidth) / (spriteWidth - 1);
 TextureBuffer[3].Y:= frame * realHeight;
 TextureBuffer[5].X:= TextureBuffer[3].X + nWaves;
 TextureBuffer[5].Y:= frame * realHeight;
diff -r 31184d9b9bfc -r 4d818abdc00f hedgewars/uVariables.pas
--- a/hedgewars/uVariables.pas	Sat Apr 08 17:17:28 2017 +0200
+++ b/hedgewars/uVariables.pas	Sat Apr 08 17:21:22 2017 +0200
@@ -2766,7 +2766,7 @@
     vobFallSpeed:= 100;
     watFrames:= 1;
     watFrameTicks:= 0;
-    watMove:= 10;
+    watMove:= 1;
 
     vobSDFrameTicks:= 0;
     vobSDFramesCount:= 4;
@@ -2775,7 +2775,7 @@
     vobSDFallSpeed:= 250;
     watSDFrames:= 1;
     watSDFrameTicks:= 0;
-    watSDMove:= 10;
+    watSDMove:= 1;
 
 {$IFDEF MOBILE}
     cMinScreenWidth  := min(cScreenWidth, 480);