Module:GauTest/Township: Difference between revisions

From Melvor Idle
No edit summary
No edit summary
Line 478: Line 478:
-- Gets the modifiers for the specified entity
-- Gets the modifiers for the specified entity
function p.GetModifiers(name, type)
function p.GetModifiers(name, type)
local function findID(_table, name)
for key, value in pairs(_table) do
if _table[key].name == name then
return key
end
end
error('name not found within _table')
end
if type == 'building' then
if type == 'building' then
return p._GetBuildingModifiers(p._GetBuildingByName(name))
return p._GetBuildingModifiers(p._GetBuildingByName(name))