diff options
Diffstat (limited to 'src/shared/lua_api/common.c')
| -rw-r--r-- | src/shared/lua_api/common.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/shared/lua_api/common.c b/src/shared/lua_api/common.c index 50eb850..9a8baca 100644 --- a/src/shared/lua_api/common.c +++ b/src/shared/lua_api/common.c @@ -86,6 +86,31 @@ int pushvector2i(lua_State* L, long a, long b){ return 1; } +int popvector4i(lua_State* L,long* a,long* b,long* c, long* d){ + lua_pushinteger(L,1);//{v4},1 + lua_gettable(L,-2);//{v4},v4[1] + *a = lua_tointeger(L,-1);//{v4},v4[1] + lua_pop(L,1);//{v4} + + lua_pushinteger(L,2);//{v4},2 + lua_gettable(L,-2);//{v4},v4[2] + *b = lua_tointeger(L,-1);//{v4},v4[2] + lua_pop(L,1);//{v4} + + lua_pushinteger(L,3);//{v4},3 + lua_gettable(L,-2);//{v4},v4[3] + *c = lua_tointeger(L,-1);//{v4},v4[3] + lua_pop(L,1);//{v4} + + lua_pushinteger(L,4);//{v4},3 + lua_gettable(L,-2);//{v4},v4[3] + *d = lua_tointeger(L,-1);//{v4},v4[3] + lua_pop(L,1);//{v4} + + lua_pop(L,1);// + return 0; +} + int popvector3i(lua_State* L,long* a,long* b,long* c){//{v3} lua_pushinteger(L,1);//{v3},1 lua_gettable(L,-2);//{v3},v3[1] |
