diff --git a/src/lua_baselib.c b/src/lua_baselib.c index 446eaa164..5bd9bec8c 100644 --- a/src/lua_baselib.c +++ b/src/lua_baselib.c @@ -4374,7 +4374,9 @@ static int lib_kItemLitterActive(lua_State *L) static int lib_kItemListActive(lua_State *L) { - lua_pushboolean(L, K_ItemListActive()); + // Use the y_inter version so that Lua scripters don't have to do a + // useless player headcount check. + lua_pushboolean(L, Y_ItemListActive()); return 1; } diff --git a/src/y_inter.c b/src/y_inter.c index c4b14c20b..760bbb134 100644 --- a/src/y_inter.c +++ b/src/y_inter.c @@ -91,19 +91,6 @@ typedef struct boolean encore; // encore mode } y_data; -static boolean Y_ItemListActive(void) -{ - UINT8 i = 0, nump = 0; - for (i = 0; i < MAXPLAYERS; i++) - { - if (!playeringame[i] || players[i].spectator) - continue; - nump++; - } - - return ((itemlistactive) && (nump > 1)); -} - static y_data data; // graphics @@ -360,6 +347,19 @@ static void Y_CalculateMatchData(UINT8 rankingsmode, void (*comparison)(INT32)) } } +boolean Y_ItemListActive(void) +{ + UINT8 i = 0, nump = 0; + for (i = 0; i < MAXPLAYERS; i++) + { + if (!playeringame[i] || players[i].spectator) + continue; + nump++; + } + + return ((itemlistactive) && (nump > 1)); +} + // // Y_ConsiderScreenBuffer // diff --git a/src/y_inter.h b/src/y_inter.h index f712b96db..ef689fa18 100644 --- a/src/y_inter.h +++ b/src/y_inter.h @@ -18,6 +18,7 @@ extern "C" { extern boolean usebuffer; +boolean Y_ItemListActive(void); void Y_IntermissionDrawer(void); void Y_Ticker(void);