Server: Flush 'skyname' serverinfo before setting the .bsp one, to prevent

it from bleeding to maps that don't define 'skyname' from old configs.
This commit is contained in:
Marco Cawthorne 2021-04-22 12:14:56 +02:00
parent ead2ab6a6b
commit 96a748f189
2 changed files with 5 additions and 1 deletions

View File

@ -21,6 +21,6 @@ Sky_Update(int force)
{
if (g_strSkyName != serverkey("skyname") || force == TRUE) {
g_strSkyName = serverkey("skyname");
localcmd(sprintf("sky %s\n", g_strSkyName));
localcmd(sprintf("sky \"%s\"\n", g_strSkyName));
}
}

View File

@ -533,6 +533,10 @@ worldspawn(void)
if (autocvar_sv_levelexec)
readcmd(sprintf("exec maps/%s.cfg\n", mapname));
/* we need to flush this, so that any leftover serverinfo
* in the server-config gets overwritten */
forceinfokey(world, "skyname", "");
/* Set the default sky */
if (serverkeyfloat("*bspversion") == BSPVER_HL) {
if (!self.skyname) {