From cd7ce5698ca89162ea937962530b94e552cad047 Mon Sep 17 00:00:00 2001 From: Indev Date: Fri, 5 Sep 2025 17:34:09 +0300 Subject: [PATCH] Update vote background if hud.setVoteBackground was called on vote screen --- src/lua_hudlib.c | 4 ++++ src/y_inter.c | 2 +- src/y_inter.h | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/lua_hudlib.c b/src/lua_hudlib.c index 98120cebf..c33b2fca1 100644 --- a/src/lua_hudlib.c +++ b/src/lua_hudlib.c @@ -1278,6 +1278,10 @@ static int lib_hudsetvotebackground(lua_State *L) strncpy(VoteScreen.luaPrefix, prefix, 4); strupr(VoteScreen.luaPrefix); + // Update background if we're already on vote screen + if (gamestate == GS_VOTING) + Y_VoteScreenCheck(); + return 0; } diff --git a/src/y_inter.c b/src/y_inter.c index 0c096127a..bbd9f11fe 100644 --- a/src/y_inter.c +++ b/src/y_inter.c @@ -820,7 +820,7 @@ static void Y_FollowIntermission(void) // // Y_VoteScreenCheck // -static void Y_VoteScreenCheck(void) +void Y_VoteScreenCheck(void) { strcpy(VoteScreen.Prefix, "INTS"); diff --git a/src/y_inter.h b/src/y_inter.h index be8592357..31dc96694 100644 --- a/src/y_inter.h +++ b/src/y_inter.h @@ -21,6 +21,7 @@ void Y_VoteTicker(void); void Y_StartVote(void); void Y_EndVote(void); void Y_SetupVoteFinish(SINT8 pick, SINT8 level); +void Y_VoteScreenCheck(void); typedef struct {