share/hedgewars/Data/Scripts/Multiplayer/Gravity.lua
changeset 10509 d62d3c706947
parent 9985 42cd42e44c9a
child 10738 62659c427e5d
--- a/share/hedgewars/Data/Scripts/Multiplayer/Gravity.lua	Sun Nov 16 17:56:27 2014 +0100
+++ b/share/hedgewars/Data/Scripts/Multiplayer/Gravity.lua	Sun Nov 16 22:23:28 2014 +0100
@@ -46,7 +46,7 @@
             if delta > 0 and gravity + delta > maxgravity then
                 gravity = maxgravity
                 delta = -delta
-            elseif delta < 0 and gravity - delta < mingravity then
+            elseif delta < 0 and gravity + delta < mingravity then
                 gravity = mingravity
                 delta = -delta
             else
@@ -80,12 +80,14 @@
             period = 125
         end
 
+        mingravity = mingravity * mln
+        maxgravity = maxgravity * mln
+
+        -- note: mingravity and maxgravity MUST NOT be strings at this point
         if mingravity > maxgravity then
             mingravity, maxgravity = maxgravity, mingravity
         end
 
-        mingravity = mingravity * mln
-        maxgravity = maxgravity * mln
         gravity = mingravity
 
         if period > 0 then