aboutsummaryrefslogtreecommitdiff
path: root/src/client/lua_api/phys/cbphysmodel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/lua_api/phys/cbphysmodel.cpp')
-rw-r--r--src/client/lua_api/phys/cbphysmodel.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/client/lua_api/phys/cbphysmodel.cpp b/src/client/lua_api/phys/cbphysmodel.cpp
index ac27288..ae2559e 100644
--- a/src/client/lua_api/phys/cbphysmodel.cpp
+++ b/src/client/lua_api/phys/cbphysmodel.cpp
@@ -6,6 +6,7 @@
#include <map>
#include <functional>
#include <list>
+#include <assert.h>
extern "C" {
#include <lua.h>
#include <lauxlib.h>
@@ -260,9 +261,12 @@ static const luaL_reg bphysmodel_m[] = {
{0, 0},
};
-int cbphysmodel_register(lua_State* L){
+void cbphysmodel_register(lua_State* L){
+ assert(lua_gettop(L) == 0);
bphysmodel_register(L);
+ assert(lua_gettop(L) == 0);
+ assert(lua_gettop(L) == 0);
luaL_getmetatable(L,"phys.physmodel");//{physmodel_m}
lua_getfield(L,-1,"__index");//{physmodel_m},{}
luaL_register(L,NULL,igeneric_m); //Inherit all the things to do with scene nodes
@@ -270,9 +274,11 @@ int cbphysmodel_register(lua_State* L){
luaL_register(L,NULL,brigidbody_m);//Add rigidbody things
luaL_register(L,NULL,bphysmodel_m);//anything specific?
lua_pop(L,2);
+ assert(lua_gettop(L) == 0);
+ assert(lua_gettop(L) == 0);
lua_getglobal(L,"phys");
luaL_register(L,NULL,bphysmodel_f);
-
- return 1;
+ lua_pop(L,1);
+ assert(lua_gettop(L) == 0);
}