Module:Sandbox/LVL: Difference between revisionsGive feedback
No edit summary |
No edit summary |
||
| Line 122: | Line 122: | ||
if stats_to_include[category] ~= nil then | if stats_to_include[category] ~= nil then | ||
for _, attr_key in ipairs(stats_to_include[category]) do | for _, attr_key in ipairs(stats_to_include[category]) do | ||
-- Base value: | -- Base value: only use AltFire if the stat actually exists there | ||
local base_value | local base_value | ||
if is_alt_fire and | if is_alt_fire and hero_data.Weapon and hero_data.Weapon.AltFire | ||
and hero_data.Weapon.AltFire[attr_key] ~= nil then | |||
base_value = hero_data.Weapon.AltFire[attr_key] | |||
else | else | ||
base_value = get_nested_stat_value(hero_data, attr_key) | base_value = get_nested_stat_value(hero_data, attr_key) | ||
| Line 132: | Line 133: | ||
local stat_value = base_value | local stat_value = base_value | ||
-- | -- Scaling: only look for AltFire scaling if the stat exists in AltFire | ||
local scaling_data | local scaling_data | ||
if is_alt_fire and hero_data.Weapon and hero_data.Weapon.AltFire and hero_data.Weapon.AltFire[attr_key] ~= nil then | if is_alt_fire and hero_data.Weapon and hero_data.Weapon.AltFire | ||
and hero_data.Weapon.AltFire[attr_key] ~= nil then | |||
scaling_data = hero_data_module.get_hero_scaling_data(hero_data, attr_key .. "AltFire") | scaling_data = hero_data_module.get_hero_scaling_data(hero_data, attr_key .. "AltFire") | ||
else | else | ||