Module:Sandbox/Constants: Difference between revisions

Remove nil modifiers from getModifiersDifference
(Fixed Arch tool level(s), edge case modifiers)
(Remove nil modifiers from getModifiersDifference)
 
Line 914: Line 914:
local baseName = modifierName
local baseName = modifierName
local modifier = GameData.rawData.modifierData[modifierName]
local modifier = GameData.rawData.modifierData[modifierName]
if modifier == nil then
return nil
end


if Shared.startsWith(modifierName, "increased") or Shared.startsWith(modifierName, "decreased") then
if Shared.startsWith(modifierName, "increased") or Shared.startsWith(modifierName, "decreased") then
baseName = string.sub(modifierName, 10)
baseName = string.sub(modifierName, 10)
end
if modifier == nil then
return nil
end
end


Line 1,192: Line 1,192:
end
end
modDiff[modName] = (modDiff[modName] or 0) + math.abs(value)
modDiff[modName] = (modDiff[modName] or 0) + math.abs(value)
if GameData.rawData.modifierData[modName] == nil then
modDiff[modName] = nil
end
end
end
end
end
463

edits