Anonymous

Module:Magic: Difference between revisions

From Melvor Idle
Undo revision 77403 by Ricewind (talk)
(Undo revision 77404 by Ricewind (talk))
Tag: Undo
(Undo revision 77403 by Ricewind (talk))
Tag: Undo
Line 80: Line 80:
end
end


function p.getSpellByProperty(spellProperty, propertyName, spellType, namespace)
function p.getSpellByProperty(spellProperty, propertyName, spellType)
if spellType == nil then
if spellType == nil then
-- Look for spell in all spellbooks
-- Look for spell in all spellbooks
Line 88: Line 88:
local spell = GameData.getEntityByProperty(spells, propertyName, spellProperty)
local spell = GameData.getEntityByProperty(spells, propertyName, spellProperty)
if spell ~= nil then
if spell ~= nil then
local ns, _ = Shared.getLocalID(spell.id)
return spell
if namespace == nil or ns == namespace then
return spell
end
end
end
end
end
2,875

edits