lule
December 24th, 2013, 11:41
Hello FG-Users,
I have some troubles with a part of the code in the VersionManager.
Here is the code:
local talentknoten = DB.findNode(charknoten..".skilllist");
Debug.console("charknoten", charknoten);
Debug.console("talentknoten", talentknoten);
if talentknoten then
for v,k in pairs(talentknoten.getChildren()) do
--[[Lule: v = name of the node, k = node itself]]
Debug.console("v", v);
Debug.console("k", k);
if v == "kampf" then
for a,s in pairs(k.getChildren()) do
Debug.console("a", a);
Debug.console("s", s);
pruefknoten = s.getChild("at");
if pruefknoten then
DB.copyNode(charknoten .. ".skilllist." .. v .. "." .. a .. ".at", charknoten .. ".skilllist." .. v .. "." .. a .. ".attackeTalentwert");
pruefknoten.delete();
end
And here the Log of the console:
Runtime Notice: s'charknoten' | s'charsheet.id-00001'
Runtime Notice: s'talentknoten' | databasenode = { charsheet.id-00001.skilllist }
Runtime Notice: s'v' | s'kampf'
Runtime Notice: s'k' | databasenode = { charsheet.id-00001.skilllist.kampf }
Runtime Notice: s'a' | s'id-00002'
Runtime Notice: s's' | databasenode = { charsheet.id-00001.skilllist.kampf.id-00002 }
Script Error: [string "scripts/manager_version.lua"]:811: copyNode: Destination node can not be the same as or a child of the source node
They are not the same node, as they end differently ".at" vs. ".attackeTalentwert" and they are not a child of each other. Or am I logically wrong here?
Is something wrong in the code or is there a bug in the copyNode-function?
Regards,
Lule
I have some troubles with a part of the code in the VersionManager.
Here is the code:
local talentknoten = DB.findNode(charknoten..".skilllist");
Debug.console("charknoten", charknoten);
Debug.console("talentknoten", talentknoten);
if talentknoten then
for v,k in pairs(talentknoten.getChildren()) do
--[[Lule: v = name of the node, k = node itself]]
Debug.console("v", v);
Debug.console("k", k);
if v == "kampf" then
for a,s in pairs(k.getChildren()) do
Debug.console("a", a);
Debug.console("s", s);
pruefknoten = s.getChild("at");
if pruefknoten then
DB.copyNode(charknoten .. ".skilllist." .. v .. "." .. a .. ".at", charknoten .. ".skilllist." .. v .. "." .. a .. ".attackeTalentwert");
pruefknoten.delete();
end
And here the Log of the console:
Runtime Notice: s'charknoten' | s'charsheet.id-00001'
Runtime Notice: s'talentknoten' | databasenode = { charsheet.id-00001.skilllist }
Runtime Notice: s'v' | s'kampf'
Runtime Notice: s'k' | databasenode = { charsheet.id-00001.skilllist.kampf }
Runtime Notice: s'a' | s'id-00002'
Runtime Notice: s's' | databasenode = { charsheet.id-00001.skilllist.kampf.id-00002 }
Script Error: [string "scripts/manager_version.lua"]:811: copyNode: Destination node can not be the same as or a child of the source node
They are not the same node, as they end differently ".at" vs. ".attackeTalentwert" and they are not a child of each other. Or am I logically wrong here?
Is something wrong in the code or is there a bug in the copyNode-function?
Regards,
Lule