Add “rounds” script parameter for Racer
authorWuzzy <almikes@aol.com>
Wed, 13 Apr 2016 14:00:53 +0200
changeset 11926 ace20b1d8d53
parent 11925 7123bfc9643c
child 11927 72593678e8d6
Add “rounds” script parameter for Racer
share/hedgewars/Data/Scripts/Multiplayer/Racer.lua
--- a/share/hedgewars/Data/Scripts/Multiplayer/Racer.lua	Wed Apr 13 14:00:03 2016 +0200
+++ b/share/hedgewars/Data/Scripts/Multiplayer/Racer.lua	Wed Apr 13 14:00:53 2016 +0200
@@ -169,6 +169,12 @@
     if params["teamrope"] ~= nil then
         TeamRope = true
     end
+    if params["rounds"] ~= nil then
+        roundLimit = math.max(1, math.floor(tonumber(params["rounds"])))
+        if type(roundLimit) ~= "number" then
+             roundLimit = 3
+        end
+    end
 end
 
 function RebuildTeamInfo()