From d5fdd9957f8c13fec59792ed6d0863dd033e164c Mon Sep 17 00:00:00 2001 From: NepDisk Date: Mon, 21 Apr 2025 20:20:35 -0400 Subject: [PATCH] Fix splitscren parties not working in kart scripts --- src/lua_script.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/lua_script.c b/src/lua_script.c index f9c940a92..7ad34db89 100644 --- a/src/lua_script.c +++ b/src/lua_script.c @@ -181,7 +181,13 @@ int LUA_PushGlobals(lua_State *L, const char *word) lua_pushboolean(L, modeattacking); return 1; } else if (fastcmp(word,"splitscreen")) { - lua_pushinteger(L, splitscreen); + // You may be wondering why? + // Kart lua scripts expects splitscreen to mean "number of split views" + // not "number of local players" + if (lua_compatmode) + lua_pushinteger(L, r_splitscreen); + else + lua_pushinteger(L, splitscreen); return 1; } else if (fastcmp(word,"gamecomplete")) { lua_pushboolean(L, (gamecomplete != 0));