LuaRules::RunCallIn: error = 2, UnitCreated, [string "LuaRules/Gadgets/grts_holdpsition.lua"]:30: GiveOrderToUnit() recursion is not permitted
stack traceback:
include file is just some defines for my unit list. so don't worry about that.function gadget:GetInfo()
return {
name = "Hold postion gadget",
desc = "sets unit on creation to hold position",
author = "smoth",
date = "2010-09-23",
license = "pd",
layer = 300,
enabled = true
}
end
local holdGroup
if VFS.FileExists("LuaRules/Configs/holdposition.lua") then
holdGroup = VFS.Include("LuaRules/Configs/holdposition.lua")
else
error("missing file: LuaRules/Configs/holdposition.lua")
end
-- for K,V in pairs(holdGroup) do
-- Spring.Echo(K,V)
-- end
if (gadgetHandler:IsSyncedCode()) then
function gadget:UnitCreated(u, ud, team, builder)
if(holdGroup and holdGroup[UnitDefs[ud].name]) then
Spring.Echo(u, ud, team, builder)--
Spring.GiveOrderToUnit(u, CMD.MOVE_STATE, { 0 }, 0)
end
end
end
here is the issue, when I am in sandbox mode and say I place more that I am permitted say unit is restricted to 5 units and I order a commander to build 6, I get this error. I was wondering why it is seeming to believe i am making a recursive call on the units that are set to be built?
Repeatable error in sandbox commander mode of gundam rts(current release). Repeat steps: grab zeon commander line order >5 zakusnipers.
I do not really need a fix for this, I merely want to know why it seems to think I am trying recursion.