mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-03-23 19:31:05 +00:00
Made it possible to just call EV_CrumbleChain(rover)
in Lua
This commit is contained in:
parent
64517a1362
commit
1d799630af
1 changed files with 11 additions and 4 deletions
|
@ -2047,12 +2047,19 @@ static int lib_pStartQuake(lua_State *L)
|
|||
|
||||
static int lib_evCrumbleChain(lua_State *L)
|
||||
{
|
||||
sector_t *sec = *((sector_t **)luaL_checkudata(L, 1, META_SECTOR));
|
||||
ffloor_t *rover = *((ffloor_t **)luaL_checkudata(L, 2, META_FFLOOR));
|
||||
sector_t *sec = NULL;
|
||||
ffloor_t *rover = NULL;
|
||||
NOHUD
|
||||
INLEVEL
|
||||
/*if (!sec)
|
||||
return LUA_ErrInvalid(L, "sector_t");*/
|
||||
if (lua_isuserdata(L, 2))
|
||||
{
|
||||
sec = *((sector_t **)luaL_checkudata(L, 1, META_SECTOR));
|
||||
rover = *((ffloor_t **)luaL_checkudata(L, 2, META_FFLOOR));
|
||||
if (!sec)
|
||||
return LUA_ErrInvalid(L, "sector_t");
|
||||
}
|
||||
else
|
||||
rover = *((ffloor_t **)luaL_checkudata(L, 1, META_FFLOOR));
|
||||
if (!rover)
|
||||
return LUA_ErrInvalid(L, "ffloor_t");
|
||||
EV_CrumbleChain(sec, rover);
|
||||
|
|
Loading…
Reference in a new issue