Getting nil when querying loadout infos by ID
lukaszsmoczynski opened this issue ยท 2 comments
If I try to invoke GlobalAPI:GetLoadoutInfoByID
the parameter is always set to nil.
Example code:
local gAPI = TalentLoadoutManagerAPI.GlobalAPI;
local loadouts = gAPI.GetLoadoutIDs();
print(loadouts[1]); -- here I get proper value like "C_1" or some numeric value corresponding to blizzard talents
local info = gAPI.GetLoadoutInfoByID(loadouts[1]);
print(info); --info is nil
I tried to "debug" it like that:
--in ManagerApi.lua file
function GlobalAPI:GetLoadoutInfoByID(loadoutID)
print(loadoutID); -- it prints nil
local displayInfo = TLM:GetLoadoutByID(loadoutID);
return displayInfo and CreateLoadoutInfoFromDisplayInfo(displayInfo);
end
use a :
instead of a .
e.g.
local gAPI = TalentLoadoutManagerAPI.GlobalAPI;
local loadouts = gAPI:GetLoadoutIDs();
print(loadouts[1]); -- here I get proper value like "C_1" or some numeric value corresponding to blizzard talents
local info = gAPI:GetLoadoutInfoByID(loadouts[1]);
print(info); -- table