Anonymous

Module:Modifiers: Difference between revisions

From Melvor Idle
getTemplateData: Fix actionID handling for Firemaking
(Implement modType criteria for checking if a modifier is deemed to have a positive or negative effect upon the target)
(getTemplateData: Fix actionID handling for Firemaking)
Line 553: Line 553:
else
else
local actionName = action.name
local actionName = action.name
if actionName == nil and action.productID ~= nil then
if actionName == nil then
local productItem = GameData.getEntityByID('items', action.productID)
-- May use the product name instead
actionName = productItem.name
local productKey = (
(scopeSourceID == 'melvorD:Firemaking' and 'logID')
or 'productID'
)
local productID = action[productKey]
if productID ~= nil then
local productItem = GameData.getEntityByID('items', productID)
actionName = productItem.name
end
end
end
tVal = (action ~= nil and (actionName or v)) or Shared.printError('Unknown action: ' .. v, ' for scope source ID ' .. scopeSourceID)
tVal = (action ~= nil and (actionName or v)) or Shared.printError('Unknown action: ' .. v, ' for scope source ID ' .. scopeSourceID)