# HG changeset patch # User Wuzzy # Date 1460548973 -7200 # Node ID 167de692f2d764efc86d052d68ffdb8eb140bfd2 # Parent 42e90b244e11acf5c422ede0cc0ec4e83987fc3e Add new Racer script parameter: waypointradius diff -r 42e90b244e11 -r 167de692f2d7 share/hedgewars/Data/Scripts/Multiplayer/Racer.lua --- a/share/hedgewars/Data/Scripts/Multiplayer/Racer.lua Sat Nov 19 20:22:55 2016 +0100 +++ b/share/hedgewars/Data/Scripts/Multiplayer/Racer.lua Wed Apr 13 14:02:53 2016 +0200 @@ -146,7 +146,7 @@ local wpY = {} local wpCol = {} local wpActive = {} -local wpRad = 450 --75 +local wpRad = 450 local wpCount = 0 local wpLimit = 8 @@ -164,6 +164,20 @@ -- general methods ------------------- +--[[ +Parameters syntax: + +teamrope=true +--> The team will be colored in the color of the team. + +rounds=N +--> The game will be played with N rounds (default: 3) + +waypointradius=N +--> The waypoints have a radius of N pixels (default: 450) + +]] + function onParameters() parseParams() if params["teamrope"] ~= nil then @@ -175,6 +189,12 @@ roundLimit = 3 end end + if params["waypointradius"] ~= nil then + wpRad = math.max(40, math.floor(tonumber(params["waypointradius"]))) + if type(roundLimit) ~= "number" then + wpRad = 450 + end + end end function RebuildTeamInfo()