From f1a9426100aafe4af9b34ffab0d4173af99f5da5 Mon Sep 17 00:00:00 2001 From: wolfy852 Date: Sat, 11 May 2019 02:13:31 -0500 Subject: [PATCH] Expose followerready, match d_player.h organization --- src/lua_playerlib.c | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/src/lua_playerlib.c b/src/lua_playerlib.c index 795dab1a..02d81f0c 100644 --- a/src/lua_playerlib.c +++ b/src/lua_playerlib.c @@ -154,6 +154,12 @@ static int player_get(lua_State *L) lua_pushinteger(L, plr->kartspeed); else if (fastcmp(field,"kartweight")) lua_pushinteger(L, plr->kartweight); + else if (fastcmp(field,"followerskin")) + lua_pushinteger(L, plr->followerskin); + else if (fastcmp(field,"followerready")) + lua_pushboolean(L, plr->followerready); + else if (fastcmp(field,"follower")) + LUA_PushUserdata(L, plr->follower, META_MOBJ); // else if (fastcmp(field,"normalspeed")) lua_pushfixed(L, plr->normalspeed); @@ -319,10 +325,7 @@ static int player_get(lua_State *L) lua_pushinteger(L, plr->awayviewtics); else if (fastcmp(field,"awayviewaiming")) lua_pushangle(L, plr->awayviewaiming); - else if (fastcmp(field,"follower")) - LUA_PushUserdata(L, plr->follower, META_MOBJ); - else if (fastcmp(field,"followerskin")) - lua_pushinteger(L, plr->followerskin); + else if (fastcmp(field,"spectator")) lua_pushboolean(L, plr->spectator); else if (fastcmp(field,"bot")) @@ -434,6 +437,12 @@ static int player_set(lua_State *L) plr->kartspeed = (UINT8)luaL_checkinteger(L, 3); else if (fastcmp(field,"kartweight")) plr->kartweight = (UINT8)luaL_checkinteger(L, 3); + else if (fastcmp(field,"followerskin")) + plr->followerskin = luaL_checkinteger(L, 3); + else if (fastcmp(field,"followerready")) + plr->followerready = luaL_checkboolean(L, 3); + else if (fastcmp(field,"follower")) // it's probably best we don't allow the follower mobj to change. + return NOSET; // else if (fastcmp(field,"normalspeed")) plr->normalspeed = luaL_checkfixed(L, 3); @@ -613,10 +622,6 @@ static int player_set(lua_State *L) } else if (fastcmp(field,"awayviewaiming")) plr->awayviewaiming = luaL_checkangle(L, 3); - else if (fastcmp(field,"follower")) // it's probably best we don't allow the follower mobj to change. - return NOSET; - else if (fastcmp(field,"followerskin")) - plr->followerskin = luaL_checkinteger(L, 3); else if (fastcmp(field,"spectator")) plr->spectator = lua_toboolean(L, 3); else if (fastcmp(field,"bot"))