NSMonster: handle the check for MSF_MULTIPLAYER inside Spawned() instead of the constructor

This commit is contained in:
Marco Cawthorne 2023-11-18 12:09:49 -08:00
parent 0cd5d0e5a7
commit 29e7b84e4b
Signed by: eukara
GPG key ID: CE2032F0A2882A22
2 changed files with 15 additions and 6 deletions

View file

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

View file

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