PDA

View Full Version : ActorManager.getActorRecordTypeFromPath return sType instead of vType



drvolk
July 14th, 2022, 14:50
I am just trying to understand how to use the ActorManager.
I noticed that in the function "getActorRecordTypeFromPath" probably the correct parameter is not returned (i would expect vType instead of sType):


-- Internal use only
function getActorRecordTypeFromPath(sActorNodePath)
if StringManager.startsWith(sActorNodePath, CombatManager.CT_MAIN_PATH .. ".") then
return "ct";
end

local sType = LibraryData.getRecordTypeFromRecordPath(sActorNode Path);
if _tActorRecordTypes[sType] then
return sType;
end

for sTypePath, vType in pairs(_tActorTypePathHandlers) do
if UtilityManager.isDataBaseNodePathMatch(sActorNodeP ath, sTypePath) then
if type(vType) == "function" then
return vType(sActorNodePath);
else
return sType;
end
end
end

return nil;
end

Another issue, i do not understand how this could work, is the usage of a global param "sType" which seams not to set in the manager script (in my opinion the check will allways fail ..):


function registerActorRecordType(sRecordType)
if sType == "ct" then
return;
end
_tActorRecordTypes[sRecordType] = true;
end

Moon Wizard
July 14th, 2022, 17:51
Thanks for pointing these out. I'll take a look.

Regards,
JPG

Moon Wizard
July 15th, 2022, 01:49
This is addressed in the hot fix pushed today.

Regards,
JPG

drvolk
July 15th, 2022, 05:52
i just checked the hotfix, looks good :)

But I noticed another "sType" condition, where I think it has no effect:


function registerActorTypePathHandler(sPath, v)
if sType == "ct" then
return;
end
_tActorTypePathHandlers[sPath] = v;
end

Moon Wizard
July 15th, 2022, 06:32
Bah, even I get caught up in copy/paste frenzy; I'll smash that on the next CoreRPG update, whenever it is.

Thanks,
JPG