addCommandHandler("move",function(_,_,mapname,x,y,z)
local ticks = getTickCount()
local map = xmlLoadFile(mapname..".map")
local file = xmlCopyFile(map,mapname.."_Moved.map")
xmlUnloadFile(map)
local nodes = xmlNodeGetChildren(file)
for k,v in ipairs (nodes) do
xmlNodeSetAttribute(v,"posX",xmlNodeGetAttribute(v,"posX")+x)
xmlNodeSetAttribute(v,"posY",xmlNodeGetAttribute(v,"posY")+y)
xmlNodeSetAttribute(v,"posZ",xmlNodeGetAttribute(v,"posZ")+z)
end
xmlSaveFile(file)
xmlUnloadFile(file)
print("MapMove: Moving \""..mapname..".map\" done in "..getTickCount()-ticks.." miliseconds with "..#nodes.." elements !")
end)
things that are fine:
-file, nodes, and map is proper elements/tables
-loop is entered
-output is fine and with proper values, like it should be
-no errors
now the problem:
map is not saving, adding it manually before didnt help, too.