From f42dee18712113a3aeaa921d9c7d7e629915b85b Mon Sep 17 00:00:00 2001 From: GoldenTails Date: Thu, 5 Nov 2020 13:43:33 -0600 Subject: [PATCH] Make `displayplayer` writable. --- src/lua_script.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/lua_script.c b/src/lua_script.c index 3e749b31b..be33cd35b 100644 --- a/src/lua_script.c +++ b/src/lua_script.c @@ -382,6 +382,13 @@ int LUA_CheckGlobals(lua_State *L, const char *word) token = (UINT32)luaL_checkinteger(L, 2); else if (fastcmp(word, "gravity")) gravity = (fixed_t)luaL_checkinteger(L, 2); + else if (fastcmp(word, "displayplayer")) + { + player_t *player = *((player_t **)luaL_checkudata(L, 2, META_PLAYER)); + + if (player) + displayplayer = player - players; + } else return 0;