Anonymous

Module:GameData: Difference between revisions

From Melvor Idle
getEntityByProperty: Fix if propName is anything other than 'id'
(getSkillData: Fix)
(getEntityByProperty: Fix if propName is anything other than 'id')
Line 108: Line 108:
elseif type(entData) ~= 'table' then
elseif type(entData) ~= 'table' then
error('Entity data is not a table: ' .. entityType, 2)
error('Entity data is not a table: ' .. entityType, 2)
elseif type(entData[1]) ~= 'table' or entData[1].id == nil then
elseif type(entData[1]) ~= 'table' or entData[1][propName] == nil then
error('Entity data is not composed of entities: ' .. entityType, 2)
error('Entity data is not composed of entities: ' .. entityType, 2)
end
end