From 355589a9100c7d08fdc4094ad32eb9852c88fcc4 Mon Sep 17 00:00:00 2001 From: Alexander Date: Mon, 18 May 2020 13:41:40 -0400 Subject: various updates --- src/client/lua_api/phys/cbcharactercontroller.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/client/lua_api/phys') diff --git a/src/client/lua_api/phys/cbcharactercontroller.cpp b/src/client/lua_api/phys/cbcharactercontroller.cpp index 16ad1ad..f93d01a 100644 --- a/src/client/lua_api/phys/cbcharactercontroller.cpp +++ b/src/client/lua_api/phys/cbcharactercontroller.cpp @@ -9,6 +9,7 @@ extern "C" { #include #include +#include #include #include "cbphysbox.hpp" #include "../scene/imesh.hpp" @@ -49,6 +50,7 @@ static int newcbcharactercontroller(lua_State* L){// ISceneNode* n = (ISceneNode*)lua_touserdata(L,-1);//ud_iscenenode lua_pop(L,1); + cc->getGhostObject()->setUserPointer(n); //cc->setUserPointer(n);//TODO: what does this break? lua_newtable(L);//{} @@ -56,6 +58,8 @@ static int newcbcharactercontroller(lua_State* L){// lua_setfield(L,-2,"character");//{} lua_pushlightuserdata(L,n);//{},ud_iscenenode lua_setfield(L,-2,"node");//{} + lua_pushstring(L,"character"); + lua_setfield(L,-2,"type"); luaL_getmetatable(L,"phys.charactercontroller");//{},{phys.charactercontroller} lua_setmetatable(L,-2);//{} @@ -102,12 +106,13 @@ void cbcharactercontroller_register(lua_State* L){ lua_setfield(L,-2,"newccharactercontroller");//{} lua_pop(L,1);// - + luaL_getmetatable(L,"phys.charactercontroller");//phys.physbox lua_newtable(L);//phys.physbox,{} - luaL_register(L,NULL,brigidbody_m); + //luaL_register(L,NULL,brigidbody_m); luaL_register(L,NULL,igeneric_m); luaL_register(L,NULL,cbcharactercontroller_m);//phys.physbox,{} + luaL_register(L,NULL,bcharactercontroller_m); lua_setfield(L,-2,"__index");//phys.physbox lua_pop(L,1); -- cgit v1.2.3-70-g09d2