From: bones_was_here Date: Mon, 24 Feb 2025 20:09:41 +0000 (+1000) Subject: q3compat: downgrade multiple worldspawn error to a warning X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=refs%2Fmerge-requests%2F1481%2Fhead;p=xonotic%2Fxonotic-data.pk3dir.git q3compat: downgrade multiple worldspawn error to a warning --- diff --git a/qcsrc/server/world.qc b/qcsrc/server/world.qc index 5e4bc9c69a..a7326fca0c 100644 --- a/qcsrc/server/world.qc +++ b/qcsrc/server/world.qc @@ -757,6 +757,21 @@ void InitGameplayMode() bool world_already_spawned; spawnfunc(worldspawn) { + // Must be checked first because we don't always error() and don't want to print this twice. + if (world_already_spawned) + { + string msg = "world already spawned - you may have EXACTLY ONE worldspawn!"; + if (q3compat) // must be set during (first) worldspawn + { + // Q3 allows >1 worldspawn entity, test map: q3dmz_carnage + LOG_WARN(msg); + return; + } + else + error(msg); + } + world_already_spawned = true; + #ifdef WATERMARK string watermark_start = cvar_string("sv_watermark_start"); if (watermark_start == "") // always true on Xonotic (re)start @@ -844,10 +859,6 @@ spawnfunc(worldspawn) } } - if(world_already_spawned) - error("world already spawned - you may have EXACTLY ONE worldspawn!"); - world_already_spawned = true; - delete_fn = remove_safely; // during spawning, watch what you remove! cvar_changes_init(); // do this very early now so it REALLY matches the server config