mirror of
https://github.com/SashLilac/cambridge.git
synced 2024-11-22 14:29:02 -06:00
Fix a major bug. Also fix copy. yw milla
This commit is contained in:
parent
d38954dd69
commit
dddcd0c7a7
@ -3,7 +3,13 @@ function copy(t)
|
||||
if type(t) ~= "table" then return t end
|
||||
local meta = getmetatable(t)
|
||||
local target = {}
|
||||
for k, v in pairs(t) do target[k] = v end
|
||||
for k, v in pairs(t) do
|
||||
if type(v) == "table" then
|
||||
target[k] = copy(v)
|
||||
else
|
||||
target[k] = v
|
||||
end
|
||||
end
|
||||
setmetatable(target, meta)
|
||||
return target
|
||||
end
|
||||
|
@ -12,6 +12,8 @@ function GamemodeConfigScene:new(gamemode)
|
||||
mode_config = gamemode:provideSettings() or {}
|
||||
optioncount = #mode_config
|
||||
|
||||
print(selected_mode.hash)
|
||||
|
||||
self.highlight = 1
|
||||
|
||||
for i, j in pairs(mode_config) do
|
||||
@ -25,7 +27,7 @@ function GamemodeConfigScene:new(gamemode)
|
||||
end
|
||||
|
||||
function GamemodeConfigScene:save()
|
||||
config.gamemodesettings[selected_mode.hash] = new_config
|
||||
config.gamemodesettings[selected_mode.hash] = copy(new_config)
|
||||
end
|
||||
|
||||
function GamemodeConfigScene:render()
|
||||
|
Loading…
Reference in New Issue
Block a user