From 411e3b386161decc05d33d141dda7de7b887e34b Mon Sep 17 00:00:00 2001
From: hayaunderscore <stophayapls123@proton.me>
Date: Mon, 26 Aug 2024 10:17:42 +0800
Subject: [PATCH] r_splitscreen -> v.splitscreen As per suggestion by Sal

---
 src/lua_hudlib.c | 8 ++++++++
 src/lua_script.c | 3 ---
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/src/lua_hudlib.c b/src/lua_hudlib.c
index 824825fe7b..140aee2d66 100644
--- a/src/lua_hudlib.c
+++ b/src/lua_hudlib.c
@@ -1109,6 +1109,13 @@ static int libd_renderer(lua_State *L)
 	return 1;
 }
 
+static int libd_splitscreen(lua_State *L)
+{
+	HUDONLY
+	lua_pushinteger(L, r_splitscreen); // push splitscreen
+	return 1;
+}
+
 // M_RANDOM
 //////////////
 
@@ -1223,6 +1230,7 @@ static luaL_Reg lib_draw[] = {
 	{"dupx", libd_dupx},
 	{"dupy", libd_dupy},
 	{"renderer", libd_renderer},
+	{"splitscreen", libd_splitscreen},
 	{"localTransFlag", libd_getlocaltransflag},
 	{"drawOnMinimap", libd_drawOnMinimap},
 	{"getDeltaTime", libd_getDeltaTime},
diff --git a/src/lua_script.c b/src/lua_script.c
index 1edbae3b71..4f743efa3e 100644
--- a/src/lua_script.c
+++ b/src/lua_script.c
@@ -178,9 +178,6 @@ int LUA_PushGlobals(lua_State *L, const char *word)
 	} else if (fastcmp(word,"splitscreen")) {
 		lua_pushinteger(L, splitscreen);
 		return 1;
-	} else if (fastcmp(word,"r_splitscreen")) {
-		lua_pushinteger(L, r_splitscreen);
-		return 1;
 	} else if (fastcmp(word,"gamecomplete")) {
 		lua_pushboolean(L, (gamecomplete != 0));
 		return 1;
-- 
GitLab