mirror of
https://github.com/yquake2/yquake2remaster.git
synced 2024-11-23 04:52:07 +00:00
Make sure Q2 doesn't "forget" contents of server "address book"
The problem was that the cvars were only initialized (with CVar_Get()) if you opened the address book menu. So if you start (and possibly run) and quit the game /without/ opening that menu (or at least the "join network server" menu), the game will not save those cvars to the config when it next writes it. To prevent this, *always* initialize the cvars in M_Init().
This commit is contained in:
parent
3634ed7013
commit
1c7b02cc85
1 changed files with 9 additions and 0 deletions
|
@ -4380,6 +4380,15 @@ M_Init(void)
|
|||
Cmd_AddCommand("menu_options", M_Menu_Options_f);
|
||||
Cmd_AddCommand("menu_keys", M_Menu_Keys_f);
|
||||
Cmd_AddCommand("menu_quit", M_Menu_Quit_f);
|
||||
|
||||
/* initialize the server address book cvars (adr0, adr1, ...)
|
||||
* so the entries are not lost if you don't open the address book */
|
||||
for (int index = 0; index < NUM_ADDRESSBOOK_ENTRIES; index++)
|
||||
{
|
||||
char buffer[20];
|
||||
Com_sprintf(buffer, sizeof(buffer), "adr%d", index);
|
||||
Cvar_Get(buffer, "", CVAR_ARCHIVE);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
|
Loading…
Reference in a new issue