From 167099eb6a74c70ec37b145aa556c9de6c6993cb Mon Sep 17 00:00:00 2001 From: Noah Metzger Date: Thu, 14 Mar 2024 20:02:15 -0500 Subject: [PATCH] cmod: Update alt fire swap configstring index selection Update configstring index selection to reduce chance of conflicts, especially on maps containing a very large number of location tags. --- code/server/sv_init.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/code/server/sv_init.c b/code/server/sv_init.c index 59af799d..a2723dcc 100644 --- a/code/server/sv_init.c +++ b/code/server/sv_init.c @@ -767,7 +767,14 @@ void SV_SpawnServer( const char *mapname, qboolean killBots ) { } if ( sv_altSwapSupport->integer ) { - SV_SetConfigstring( 880, "!modcfg \\altSwapSupport\\1" ); + // try to place alt swap support value in unused configstring index + // specific index value doesn't matter since client checks all of them + for ( i = 1020; i > 1000; --i ) { + if ( !*sv.configstrings[i] ) { + SV_SetConfigstring( i, "!modcfg \\altSwapSupport\\1" ); + break; + } + } } #endif