17,481
edits
No edit summary |
(getModifierValue: Fix for modifier value ranges (from Astrology)) |
||
Line 50: | Line 50: | ||
for i, subVal in ipairs(valueArray) do | for i, subVal in ipairs(valueArray) do | ||
if type(subVal) == 'table' | if type(subVal) == 'table' then | ||
if subVal.skillID ~= nil then | |||
-- Modifier value is skill specific | |||
if skill == nil or skill == '' or subVal.skillID == skill then | |||
magnitude[modType] = magnitude[modType] + subVal.value | |||
end | |||
else | |||
-- Modifier value is a table of two numbers representing a range. Take the largest value | |||
magnitude[modType] = magnitude[modType] + (subVal[2] or 0) | |||
end | |||
else | else | ||
magnitude[modType] = magnitude[modType] + subVal | magnitude[modType] = magnitude[modType] + subVal |