some gravity script fixes
authorsheepluva
Sun, 16 Nov 2014 22:23:28 +0100
changeset 10509 d62d3c706947
parent 10508 1a91c1fcba0d
child 10510 9329dab04490
some gravity script fixes
share/hedgewars/Data/Scripts/Multiplayer/Gravity.lua
--- 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