share/hedgewars/Data/Scripts/Multiplayer/Racer.lua
changeset 15964 d18261ddac4a
parent 15788 acf70c44065b
child 15970 a803428704fd
equal deleted inserted replaced
15963:cf5c7fa71134 15964:d18261ddac4a
   189     parseParams()
   189     parseParams()
   190     if params["teamrope"] ~= nil then
   190     if params["teamrope"] ~= nil then
   191         TeamRope = true
   191         TeamRope = true
   192     end
   192     end
   193     if params["rounds"] ~= nil then
   193     if params["rounds"] ~= nil then
   194         roundLimit = math.max(1, math.floor(tonumber(params["rounds"])))
   194         roundLimit = tonumber(params["rounds"])
   195         if type(roundLimit) ~= "number" then
   195         if type(roundLimit) ~= "number" then
   196              roundLimit = 3
   196              roundLimit = 3
   197         end
   197         end
       
   198         roundLimit = math.max(1, math.floor(roundLimit))
   198     end
   199     end
   199     if params["waypointradius"] ~= nil then
   200     if params["waypointradius"] ~= nil then
   200         wpRad = math.max(WAYPOINT_RADIUS_MIN, math.floor(tonumber(params["waypointradius"])))
   201         wpRad = tonumber(params["waypointradius"])
   201         if type(wpRad) ~= "number" then
   202         if type(wpRad) ~= "number" then
   202              wpRad = 450
   203              wpRad = 450
   203         end
   204         end
       
   205         wpRad = math.max(WAYPOINT_RADIUS_MIN, math.floor(wpRad))
   204     end
   206     end
   205     if params["maxwaypoints"] ~= nil then
   207     if params["maxwaypoints"] ~= nil then
   206         wpLimit = math.max(2, math.floor(tonumber(params["maxwaypoints"])))
   208         wpLimit = tonumber(params["maxwaypoints"])
   207         if type(wpLimit) ~= "number" then
   209         if type(wpLimit) ~= "number" then
   208              wpLimit = 8
   210              wpLimit = 8
   209         end
   211         end
       
   212         wpLimit = math.max(2, math.floor(wpLimit))
   210     end
   213     end
   211 end
   214 end
   212 
   215 
   213 function RebuildTeamInfo()
   216 function RebuildTeamInfo()
   214 
   217