-
-
Notifications
You must be signed in to change notification settings - Fork 502
Description
Describe the bug
I noticed that the behavoir of this function changed and can cause now bugs in many old scripts.
The function originaly only expected strings with preceeding # sign.
Now this functions also accepts strings/numbers without preceeding # sign which causes unexpected behavoir in old scripts, because old scripts expected it to return false when it doesn't have a preceding # sign.
To reproduce
function DMRaceMapObject:parseValue(val)
if type(val) ~= 'string' then
return val
end
if #val == 0 then
return false
end
local r, g, b = getColorFromString(val)
if r then
return { r, g, b }
end
val = table.maptry(val:split(','), tonumber) or val
if type(val) == 'table' and #val == 1 then
val = val[1]
end
return val
endfor example this function in race gamemode expected it to return false
this could also break servers that have added custom attributes for .map files and didn't expect such a change
there are propably many other cases too
Expected behaviour
return false when it does not have a preceeding #
Version
with introduction of nightly version r20477
Additional context