From faf16a6ae42d83a5f750eb0fe826f82867db970c Mon Sep 17 00:00:00 2001
From: James R <justsomejames2@gmail.com>
Date: Thu, 5 Nov 2020 20:05:04 -0800
Subject: [PATCH] Let access spectator mobj

---
 src/lua_playerlib.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/src/lua_playerlib.c b/src/lua_playerlib.c
index 20e51a7405..d79666fa66 100644
--- a/src/lua_playerlib.c
+++ b/src/lua_playerlib.c
@@ -112,12 +112,7 @@ static int player_get(lua_State *L)
 	// Kept for backward-compatibility
 	// Should be fixed to work like "realmo" later
 	else if (fastcmp(field,"mo"))
-	{
-		if (plr->spectator)
-			lua_pushnil(L);
-		else
-			LUA_PushUserdata(L, plr->mo, META_MOBJ);
-	}
+		LUA_PushUserdata(L, plr->mo, META_MOBJ);
 	else if (fastcmp(field,"cmd"))
 		LUA_PushUserdata(L, &plr->cmd, META_TICCMD);
 	else if (fastcmp(field,"playerstate"))
-- 
GitLab