make new CustomSpeedMods actually work because I am awesome
This commit is contained in:
@@ -70,7 +70,7 @@ local function ParseSpeedModFile(path)
|
|||||||
-- strip any whitespace and check
|
-- strip any whitespace and check
|
||||||
for i=1,#mods do
|
for i=1,#mods do
|
||||||
string.gsub(mods[i], "%s", "")
|
string.gsub(mods[i], "%s", "")
|
||||||
if not(mods[i]:find("%d+\.?%d*x") or mods[i]:find("[cmCM]%d+")) then
|
if not(mods[i]:find("%d+.?%d*[xX]") or mods[i]:find("[cmCM]%d+")) then
|
||||||
mods[i] = nil
|
mods[i] = nil
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -101,6 +101,7 @@ local function MergeTables(parent, child)
|
|||||||
for k,v in pairs(parent) do
|
for k,v in pairs(parent) do
|
||||||
child[k] = v
|
child[k] = v
|
||||||
end
|
end
|
||||||
|
return child
|
||||||
end
|
end
|
||||||
|
|
||||||
-- code in this function is based off of code in
|
-- code in this function is based off of code in
|
||||||
@@ -191,7 +192,7 @@ local function GetSpeedMods()
|
|||||||
|
|
||||||
-- join players, overwriting duplicates
|
-- join players, overwriting duplicates
|
||||||
for ply=1,#playerMods do
|
for ply=1,#playerMods do
|
||||||
MergeTables(finalMods,InvertTable(playerMods[ply]))
|
finalMods=MergeTables(finalMods,InvertTable(playerMods[ply]))
|
||||||
end
|
end
|
||||||
|
|
||||||
-- convert into an unsorted integer-indexed table
|
-- convert into an unsorted integer-indexed table
|
||||||
|
|||||||
Reference in New Issue
Block a user