Merge pull request #60 from BjossiAlfreds/bad-triggered

Console warning and fix triggered monsters without targetname
This commit is contained in:
Yamagi 2021-03-31 10:06:58 +02:00 committed by GitHub
commit 9ea02cab1c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 13 additions and 0 deletions

View file

@ -37,6 +37,7 @@ cvar_t *maxentities;
cvar_t *g_select_empty;
cvar_t *dedicated;
cvar_t *g_footsteps;
cvar_t *g_fix_triggered;
cvar_t *filterban;

View file

@ -945,6 +945,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))
{
level.total_monsters++;

View file

@ -513,6 +513,7 @@ extern cvar_t *needpass;
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;

View file

@ -214,6 +214,7 @@ InitGame(void)
skill = gi.cvar ("skill", "1", CVAR_LATCH);
maxentities = gi.cvar ("maxentities", "1024", CVAR_LATCH);
g_footsteps = gi.cvar ("g_footsteps", "1", CVAR_ARCHIVE);
g_fix_triggered = gi.cvar ("g_fix_triggered", "0", 0);
/* change anytime vars */
dmflags = gi.cvar ("dmflags", "0", CVAR_SERVERINFO);