Skip to content

Commit

Permalink
Fix a case of weapon deck code causing booleans to enter a context ex…
Browse files Browse the repository at this point in the history
…pecting numbers
  • Loading branch information
KnightMiner committed Oct 3, 2022
1 parent 86aefdd commit cbede77
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions scripts/mod_loader/modui/_deck_selector.lua
Original file line number Diff line number Diff line change
Expand Up @@ -81,14 +81,20 @@ local currentFilter

-- loads the config for the given deck into the mod API
function deck_selector:loadConfigIntoApi(cfg)
sdlext.config(modApi:getCurrentModcontentPath(), function(config)
sdlext.config(modApi:getCurrentModcontentPath(), function(config)
if config[cfg.configKey] ~= nil then
for id, enabled in pairs(config[cfg.configKey]) do
if modApi[cfg.apiKey][id] ~= nil then
modApi[cfg.apiKey][id] = enabled
if enabled == true then
modApi[cfg.apiKey][id] = cfg.enabledValue
elseif enabled == false then
modApi[cfg.apiKey][id] = cfg.disabledValue
else
modApi[cfg.apiKey][id] = enabled
end
end
end
cfg.validateEnabled(modApi[cfg.apiKey])
cfg.validateEnabled(modApi[cfg.apiKey])
end
end)
end
Expand Down

0 comments on commit cbede77

Please sign in to comment.