Only display master server rules popup once per game boot.

Doesn't prevent it from happening later if the rules weren't successfully fetched, though.
This commit is contained in:
toaster 2022-08-17 13:52:31 +01:00
parent 5812d7343d
commit f2017fd31a

View file

@ -6342,15 +6342,18 @@ void M_RefreshPauseMenu(void)
#endif #endif
} }
boolean firstDismissedRulesThisBoot = true;
void M_PopupMasterServerRules(void) void M_PopupMasterServerRules(void)
{ {
#ifdef MASTERSERVER #ifdef MASTERSERVER
if (cv_advertise.value && (serverrunning || currentMenu == &MP_ServerDef)) if (cv_advertise.value && (serverrunning || currentMenu == &MP_ServerDef) && firstDismissedRulesThisBoot)
{ {
char *rules = GetMasterServerRules(); char *rules = GetMasterServerRules();
if (rules) if (rules)
{ {
firstDismissedRulesThisBoot = false;
M_StartMessage(va("%s\n(press any key)", rules), NULL, MM_NOTHING); M_StartMessage(va("%s\n(press any key)", rules), NULL, MM_NOTHING);
Z_Free(rules); Z_Free(rules);
} }