Commands = {}
Commands.Attack = function (FromProxy, TargetProxy) print ("Attack") end
Commands.Defend = function (FromProxy, TargetProxy) print ("Defend") end
Commands.Construct = function (FromProxy, TargetProxy) print ("Construct") end
Commands.Destroy = function (FromProxy, TartgetProxy) print ("Destroy") end
function SetPropertyCommand (Type)
return Commands
end
C++: (Commands_ is the luabind::object) ----
Commandgroup::Commandgroup (std::string Type, LuaStateObject& Luahandling):
Luahandling_ (Luahandling)
{
Commands_ = luabind::call_function <luabind::object> (Luahandling_.Getstate(),
"SetPropertyCommand", Type);
}
void Commandgroup::ExecCommand (std::string CommandName, ProxyObj& Target, ProxyObj& Source)
{
//TEST
luabind::call_function <void> (Commands_[1], boost::ref(Target),
boost::ref(Source)); //error
//TEST
}
Error: ------ Assertion failed: crep && "you are trying to use an unregistered type", file ../ ../../../Luabind/luabind/luabind/luabind/detail/policy.hpp, line 808 This application has requested the Runtime to terminate it in an unusual way. Please contact the application's support team for more information. Press any key to continue. Now I wonder if Lua returns this as a 'pass by value' or as a reference I have also tried to pass a luabind object as a reference argument (with boost::ref) but this didn't work either. Sorry if this is a noob question but I'm totally new with Lua. Thanks for your help