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
This commit is contained in:
Spoike 2018-11-08 22:27:27 +00:00
parent 6d4bd2eb61
commit 2d539675cf
1 changed files with 9 additions and 6 deletions

View File

@ -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);