Utilise execversion to one-time reset two cvars on upgrade to v1.4.

- `cv_masterserver` - Replaces a hack checking for the original SRB2 MS addres every time, and additionally catches those who tested an early version of the http MS.
- `cv_usegamma` - This was previously WAY too easy to accidentially change. This way, a user who has had this accidentially happen will automatically return to baseline.
This commit is contained in:
toaster 2022-08-11 23:46:41 +01:00
parent a60052b35d
commit cf882f4a30
2 changed files with 7 additions and 11 deletions

View file

@ -1884,6 +1884,13 @@ static boolean CV_FilterVarByVersion(consvar_t *v, const char *valstr)
if (!(v->flags & CV_SAVE))
return true;
if (GETMAJOREXECVERSION(cv_execversion.value) < 8) // 8 = 1.4
{
if (!stricmp(v->name, "masterserver") // Replaces a hack in MasterServer_OnChange for the original SRB2 MS.
|| !stricmp(v->name, "gamma")) // Too easy to accidentially change in prior versions.
return false;
}
if (GETMAJOREXECVERSION(cv_execversion.value) < 2) // 2 = 1.0.2
{
#if 0

View file

@ -554,17 +554,6 @@ static void MasterServer_OnChange(void)
#ifdef MASTERSERVER
UnregisterServer();
/*
TODO: remove this for v2, it's just a hack
for those coming in with an old config.
*/
if (
! cv_masterserver.changed &&
strcmp(cv_masterserver.string, "ms.srb2.org:28900") == 0
){
CV_StealthSet(&cv_masterserver, cv_masterserver.defaultvalue);
}
Set_api(cv_masterserver.string);
if (Online())