From 29e7b84e4bc180df4fe6f77a5084ac50a508a4fc Mon Sep 17 00:00:00 2001 From: Marco Cawthorne Date: Sat, 18 Nov 2023 12:09:49 -0800 Subject: [PATCH] NSMonster: handle the check for MSF_MULTIPLAYER inside Spawned() instead of the constructor --- src/shared/NSMonster.h | 1 + src/shared/NSMonster.qc | 20 ++++++++++++++------ 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/src/shared/NSMonster.h b/src/shared/NSMonster.h index aabc5eae..88d9235e 100644 --- a/src/shared/NSMonster.h +++ b/src/shared/NSMonster.h @@ -310,6 +310,7 @@ public: virtual float SendEntity(entity,float); virtual void Touch(entity); //virtual void Hide(void); + virtual void Spawned(void); virtual void Respawn(void); virtual void Pain(void); virtual void Death(void); diff --git a/src/shared/NSMonster.qc b/src/shared/NSMonster.qc index 342e09bd..995922a6 100644 --- a/src/shared/NSMonster.qc +++ b/src/shared/NSMonster.qc @@ -21,12 +21,6 @@ void NSMonster::NSMonster(void) { #ifdef SERVER - if (!HasSpawnFlags(MSF_MULTIPLAYER)) - if (g_grMode.MonstersSpawn() == FALSE) { - remove(this); - return; - } - m_ssLast = __NULL__; oldnet_velocity = g_vec_null; m_flPitch = 1.0f; @@ -1771,6 +1765,20 @@ NSMonster::Hide(void) } #endif +void +NSMonster::Spawned(void) +{ + if (!HasSpawnFlags(MSF_MULTIPLAYER)) { + if (g_grMode.MonstersSpawn() == FALSE) { + ReleaseThink(); + Destroy(); + return; + } + } + + super::Spawned(); +} + void NSMonster::Respawn(void) {