Module:Monsters: Difference between revisions

m
getMonsterByID now returns nil instead of erroring
(getAreaMonsterTable: Swap to use functions accepting monster object as a parameter; getMonsterBones: Rename to _getMonsterBones)
m (getMonsterByID now returns nil instead of erroring)
Line 31: Line 31:
function p.getMonsterByID(ID)
function p.getMonsterByID(ID)
local result = Shared.clone(MonsterData.Monsters[ID + 1])
local result = Shared.clone(MonsterData.Monsters[ID + 1])
result.id = ID
if result ~= nil then
return result
result.id = ID
return result
else
return nil
end
end
end


892

edits