From 2d539675cf24663d91aee59cfd0c8d06b330647b Mon Sep 17 00:00:00 2001 From: Spoike Date: Thu, 8 Nov 2018 22:27:27 +0000 Subject: [PATCH] Ignore spawnflags when CheckSpawn is defined, so that the mod can do it instead. git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5334 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/server/pr_cmds.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/engine/server/pr_cmds.c b/engine/server/pr_cmds.c index 848daa59c..ca0fb0712 100644 --- a/engine/server/pr_cmds.c +++ b/engine/server/pr_cmds.c @@ -1661,12 +1661,6 @@ static void PDECL PR_DoSpawnInitialEntity(pubprogfuncs_t *progfuncs, struct edic func_t f; char spawnfuncname[256]; - if ((int)ed->v->spawnflags & ctx->killonspawnflags) - { - ED_Free(progfuncs, (struct edict_s *)ed); - return; - } - if (!ctx->foundfuncs) { ctx->foundfuncs = true; @@ -1676,6 +1670,15 @@ static void PDECL PR_DoSpawnInitialEntity(pubprogfuncs_t *progfuncs, struct edic ctx->SV_OnEntityPostSpawnFunction = PR_FindFunction(progfuncs, "SV_OnEntityPostSpawnFunction", -2); } + //remove the entity if its spawnflags matches the ones we're killing on + //we skip this check if the mod has the CheckSpawn function defined. Such mods can do their own filtering easily enough. + //dpcompat: SV_OnEntityPreSpawnFunction does not inhibit this legacy behaviour (even though it really ought to). + if (!ctx->CheckSpawn && (int)ed->v->spawnflags & ctx->killonspawnflags) + { + ED_Free(progfuncs, (struct edict_s *)ed); + return; + } + if (ctx->SV_OnEntityPreSpawnFunction) { // void *pr_globals = PR_globals(progfuncs, PR_CURRENT);