From a4fba01b9789230ccc4fa51ccb7cdbcb79ffbb31 Mon Sep 17 00:00:00 2001 From: BjossiAlfreds Date: Sun, 28 Mar 2021 16:04:22 +0000 Subject: [PATCH] Console warning and fix triggered monsters with no targetname --- src/g_main.c | 1 + src/g_monster.c | 10 ++++++++++ src/header/local.h | 1 + src/savegame/savegame.c | 1 + 4 files changed, 13 insertions(+) diff --git a/src/g_main.c b/src/g_main.c index 8ddc3c5..f3e843c 100644 --- a/src/g_main.c +++ b/src/g_main.c @@ -38,6 +38,7 @@ cvar_t *maxentities; cvar_t *g_select_empty; cvar_t *dedicated; cvar_t *g_footsteps; +cvar_t *g_fix_triggered; cvar_t *filterban; diff --git a/src/g_monster.c b/src/g_monster.c index 274b3f1..d7c82b8 100644 --- a/src/g_monster.c +++ b/src/g_monster.c @@ -872,6 +872,16 @@ monster_start(edict_t *self) self->spawnflags |= 1; } + if ((self->spawnflags & 2) && !self->targetname) + { + if (g_fix_triggered->value) + { + self->spawnflags &= ~2; + } + + gi.dprintf ("triggered %s at %s has no targetname\n", self->classname, vtos (self->s.origin)); + } + if ((!(self->monsterinfo.aiflags & AI_GOOD_GUY)) && (!(self->monsterinfo.aiflags & AI_DO_NOT_COUNT))) { diff --git a/src/header/local.h b/src/header/local.h index 3564591..a7f779c 100644 --- a/src/header/local.h +++ b/src/header/local.h @@ -596,6 +596,7 @@ extern cvar_t *spectator_password; extern cvar_t *g_select_empty; extern cvar_t *dedicated; extern cvar_t *g_footsteps; +extern cvar_t *g_fix_triggered; extern cvar_t *filterban; diff --git a/src/savegame/savegame.c b/src/savegame/savegame.c index 3493cdc..5c424f8 100644 --- a/src/savegame/savegame.c +++ b/src/savegame/savegame.c @@ -220,6 +220,7 @@ InitGame(void) maxentities = gi.cvar ("maxentities", "1024", CVAR_LATCH); gamerules = gi.cvar ("gamerules", "0", CVAR_LATCH); //PGM g_footsteps = gi.cvar ("g_footsteps", "1", CVAR_LATCH); + g_fix_triggered = gi.cvar ("g_fix_triggered", "0", 0); /* change anytime vars */ dmflags = gi.cvar ("dmflags", "0", CVAR_SERVERINFO);