# HG changeset patch # User Adam Kaminski # Date 1612711188 18000 # Sun Feb 07 10:19:48 2021 -0500 # Node ID a1a7c521ab0c8b24bf6aa64bedd95dd76966d371 # Parent c59208acfa97ad95b25b194d4885cf2487c1e6a1 Added compatflags2, zadmflags, and zacompatflags as properties to the CMPGNINF lump. diff -r c59208acfa97 -r a1a7c521ab0c src/campaign.cpp --- a/src/campaign.cpp Sun Feb 07 10:17:18 2021 -0500 +++ b/src/campaign.cpp Sun Feb 07 10:19:48 2021 -0500 @@ -315,6 +315,9 @@ pInfo->lDMFlags = -1; pInfo->lDMFlags2 = -1; pInfo->lCompatFlags = -1; + pInfo->lCompatFlags2 = -1; + pInfo->lZaDMFlags = -1; + pInfo->lZaCompatFlags = -1; pInfo->szMapName[0] = 0; pInfo->PlayerTeamName = ""; pInfo->bMustWinAllDuels = true; @@ -431,6 +434,18 @@ { pInfo->lCompatFlags = atoi( szValue ); } + else if ( stricmp( szKey, "compatflags2" ) == 0 ) + { + pInfo->lCompatFlags2 = atoi( szValue ); + } + else if ( stricmp( szKey, "zadmflags" ) == 0 ) + { + pInfo->lZaDMFlags = atoi( szValue ); + } + else if ( stricmp( szKey, "zacompatflags" ) == 0 ) + { + pInfo->lZaCompatFlags = atoi( szValue ); + } else if ( stricmp( szKey, "playerteam" ) == 0 ) { pInfo->PlayerTeamName = szValue; diff -r c59208acfa97 -r a1a7c521ab0c src/campaign.h --- a/src/campaign.h Sun Feb 07 10:17:18 2021 -0500 +++ b/src/campaign.h Sun Feb 07 10:19:48 2021 -0500 @@ -101,6 +101,15 @@ // The compatflags that are to be used on this map. LONG lCompatFlags; + // [AK] The compatflags2 that are to be used on this map. + LONG lCompatFlags2; + + // [AK] The zadmflags that are to be used on this map. + LONG lZaDMFlags; + + // [AK] The zacompatflags that are to be used on this map. + LONG lZaCompatFlags; + // The map for which this campaign data applies. char szMapName[9]; diff -r c59208acfa97 -r a1a7c521ab0c src/d_main.cpp --- a/src/d_main.cpp Sun Feb 07 10:17:18 2021 -0500 +++ b/src/d_main.cpp Sun Feb 07 10:19:48 2021 -0500 @@ -643,7 +643,8 @@ EXTERN_CVAR(Int, gl_distfog) #endif -CUSTOM_CVAR (Int, zadmflags, 0, CVAR_SERVERINFO) +// [AK] Added CVAR_CAMPAIGNLOCK. +CUSTOM_CVAR (Int, zadmflags, 0, CVAR_SERVERINFO | CVAR_CAMPAIGNLOCK) { // [Dusk] If we just turned sv_sharedkeys on, share keys now. if ((( self ^ self.GetPastValue() ) & ZADF_SHARE_KEYS ) & ( self & ZADF_SHARE_KEYS )) @@ -712,7 +713,8 @@ } // [BB] Removed the CVAR_ARCHIVE flag. -CUSTOM_CVAR (Int, compatflags, 0, CVAR_SERVERINFO) +// [AK] Added CVAR_CAMPAIGNLOCK. +CUSTOM_CVAR (Int, compatflags, 0, CVAR_SERVERINFO | CVAR_CAMPAIGNLOCK) { int old = i_compatflags; i_compatflags = GetCompatibility(self) | ii_compatflags; @@ -727,7 +729,8 @@ } // [BB] Removed the CVAR_ARCHIVE flag. -CUSTOM_CVAR (Int, compatflags2, 0, CVAR_SERVERINFO) +// [AK] Added CVAR_CAMPAIGNLOCK. +CUSTOM_CVAR (Int, compatflags2, 0, CVAR_SERVERINFO | CVAR_CAMPAIGNLOCK) { i_compatflags2 = GetCompatibility2(self) | ii_compatflags2; @@ -742,7 +745,8 @@ // //========================================================================== -CUSTOM_CVAR (Int, zacompatflags, 0, CVAR_SERVERINFO) +// [AK] Added CVAR_CAMPAIGNLOCK. +CUSTOM_CVAR (Int, zacompatflags, 0, CVAR_SERVERINFO | CVAR_CAMPAIGNLOCK) { // [BC] If we're the server, tell clients that the dmflags changed. // [AK] Moved everything into a separate function to avoid code duplication. diff -r c59208acfa97 -r a1a7c521ab0c src/g_level.cpp --- a/src/g_level.cpp Sun Feb 07 10:17:18 2021 -0500 +++ b/src/g_level.cpp Sun Feb 07 10:19:48 2021 -0500 @@ -1176,6 +1176,21 @@ Val.Int = pInfo->lCompatFlags; compatflags.ForceSet( Val, CVAR_Int ); } + if ( pInfo->lCompatFlags2 != -1 ) + { + Val.Int = pInfo->lCompatFlags2; + compatflags2.ForceSet( Val, CVAR_Int ); + } + if ( pInfo->lZaDMFlags != -1 ) + { + Val.Int = pInfo->lZaDMFlags; + zadmflags.ForceSet( Val, CVAR_Int ); + } + if ( pInfo->lZaCompatFlags != -1 ) + { + Val.Int = pInfo->lZaCompatFlags; + zacompatflags.ForceSet( Val, CVAR_Int ); + } Val.Bool = false; deathmatch.ForceSet( Val, CVAR_Bool );