Module:Constants: Difference between revisions

getSkillName/getSkillID: Fix
(Update for v1.1)
(getSkillName/getSkillID: Fix)
Line 655: Line 655:


function p.getSkillName(skillID)
function p.getSkillName(skillID)
local skill = GameData.getEntityByID('skillData', skillID)
local skill = GameData.getSkillData(skillID)
if skill ~= nil then
if skill ~= nil then
return skill.data.name
return skill.data.name
Line 662: Line 662:


function p.getSkillID(skillName)
function p.getSkillID(skillName)
local skill = GameData.getEntityByName('skillData', skillName)
for i, skillData in ipairs(GameData.rawData.skillData) do
if skill ~= nil then
if skillData.data.name == skillName then
return skill.data.id
return skillData.skillID
end
end
end
end
end