diff options
Diffstat (limited to 'src/shared/lua_api/common.cpp')
| -rw-r--r-- | src/shared/lua_api/common.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/shared/lua_api/common.cpp b/src/shared/lua_api/common.cpp index 68bf203..b190bdb 100644 --- a/src/shared/lua_api/common.cpp +++ b/src/shared/lua_api/common.cpp @@ -190,6 +190,17 @@ int poprecti(lua_State* L, long *sx, long *sy, long *ex, long *ey){ return 0; } +int pushrecti(lua_State* L, long sx, long sy, long ex, long ey){ + lua_newtable(L);//{} + lua_pushnumber(L,1);//{},1,{sx,sy} + pushvector2i(L,sx,sy);//{},1,{sx,sy} + lua_settable(L,-3);//{{sx,sy}} + lua_pushnumber(L,2);//{{sx,sy}},2 + pushvector2i(L,ex,ey);//{{sx,sy}},2,{ex,ey} + lua_settable(L,-3);//{{sx,sy},{ex,ey}} + return 1; +} + int popvector2i(lua_State* L, long* a, long* b){ lua_pushinteger(L,1); lua_gettable(L,-2); |
