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
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