17,105
edits
(getModifiersDifference: Handle nil parameters gracefully) |
(getModifiersDifference: Exclude modifiers from output where difference is zero) |
||
Line 1,010: | Line 1,010: | ||
-- Skill specific modifier | -- Skill specific modifier | ||
for skillID, subVal in pairs(value) do | for skillID, subVal in pairs(value) do | ||
local modName = nil | if subVal ~= 0 then | ||
local modName = nil | |||
if modHasPrefix[modBaseName] then | |||
modName = (subVal < 0 and 'decreased' or 'increased') .. modBaseName | |||
modName = | else | ||
modName = modBaseName | |||
end | |||
if modDiff[modName] == nil then | |||
modDiff[modName] = {} | |||
end | |||
table.insert(modDiff[modName], { ["skillID"] = skillID, ["value"] = math.abs(subVal) }) | |||
end | end | ||
end | end | ||
elseif value ~= 0 then | |||
local modName = nil | local modName = nil | ||
if modHasPrefix[modBaseName] then | if modHasPrefix[modBaseName] then |