From 17da039ba6d5b3ec38d4ee96a0dc883a089f939d Mon Sep 17 00:00:00 2001 From: Sabian Roberts <31491602+sabianroberts@users.noreply.github.com> Date: Sat, 26 Oct 2024 00:06:25 +0100 Subject: [PATCH] Only spawn all monsters if co-op is on --- binary/dlls/apache.cpp | 10 ++++++++++ binary/dlls/barnacle.cpp | 10 ++++++++++ binary/dlls/bigmomma.cpp | 10 ++++++++++ binary/dlls/bullsquid.cpp | 10 ++++++++++ binary/dlls/controller.cpp | 10 ++++++++++ binary/dlls/gargantua.cpp | 10 ++++++++++ binary/dlls/hassassin.cpp | 10 ++++++++++ binary/dlls/headcrab.cpp | 10 ++++++++++ binary/dlls/hgrunt.cpp | 10 ++++++++++ binary/dlls/houndeye.cpp | 10 ++++++++++ binary/dlls/ichthyosaur.cpp | 10 ++++++++++ binary/dlls/islave.cpp | 10 ++++++++++ binary/dlls/nihilanth.cpp | 10 ++++++++++ binary/dlls/osprey.cpp | 10 ++++++++++ binary/dlls/tentacle.cpp | 10 ++++++++++ binary/dlls/turret.cpp | 10 ++++++++++ binary/dlls/zamn.cpp | 10 ++++++++++ binary/dlls/zombie.cpp | 10 ++++++++++ 18 files changed, 180 insertions(+) diff --git a/binary/dlls/apache.cpp b/binary/dlls/apache.cpp index 23e01986..b5d83aaa 100644 --- a/binary/dlls/apache.cpp +++ b/binary/dlls/apache.cpp @@ -116,6 +116,16 @@ IMPLEMENT_SAVERESTORE( CApache, CBaseMonster ); void CApache :: Spawn( void ) { + // Only spawn if coopmode is enabled + if (CVAR_GET_FLOAT("sv_aura_coop") == 1) + { + CBaseMonster::Spawn(); // Proceed with spawning if coopmode is on + } + else + { + // Optionally, log or remove entity if coopmode is off + UTIL_Remove(this); + } Precache( ); // motor pev->movetype = MOVETYPE_FLY; diff --git a/binary/dlls/barnacle.cpp b/binary/dlls/barnacle.cpp index 0630622a..6d81c4a0 100644 --- a/binary/dlls/barnacle.cpp +++ b/binary/dlls/barnacle.cpp @@ -102,6 +102,16 @@ void CBarnacle :: HandleAnimEvent( MonsterEvent_t *pEvent ) //========================================================= void CBarnacle :: Spawn() { + // Only spawn if coopmode is enabled + if (CVAR_GET_FLOAT("sv_aura_coop") == 1) + { + CBaseMonster::Spawn(); // Proceed with spawning if coopmode is on + } + else + { + // Optionally, log or remove entity if coopmode is off + UTIL_Remove(this); + } Precache( ); SET_MODEL(ENT(pev), "models/barnacle.mdl"); diff --git a/binary/dlls/bigmomma.cpp b/binary/dlls/bigmomma.cpp index 1aacc4fc..e337151a 100644 --- a/binary/dlls/bigmomma.cpp +++ b/binary/dlls/bigmomma.cpp @@ -657,6 +657,16 @@ void CBigMomma::LaunchMortar( void ) //========================================================= void CBigMomma :: Spawn() { + // Only spawn if coopmode is enabled + if (CVAR_GET_FLOAT("sv_aura_coop") == 1) + { + CBaseMonster::Spawn(); // Proceed with spawning if coopmode is on + } + else + { + // Optionally, log or remove entity if coopmode is off + UTIL_Remove(this); + } Precache( ); SET_MODEL(ENT(pev), "models/big_mom.mdl"); diff --git a/binary/dlls/bullsquid.cpp b/binary/dlls/bullsquid.cpp index 3c426a80..5bea2b28 100644 --- a/binary/dlls/bullsquid.cpp +++ b/binary/dlls/bullsquid.cpp @@ -668,6 +668,16 @@ void CBullsquid :: HandleAnimEvent( MonsterEvent_t *pEvent ) //========================================================= void CBullsquid :: Spawn() { + // Only spawn if coopmode is enabled + if (CVAR_GET_FLOAT("sv_aura_coop") == 1) + { + CBaseMonster::Spawn(); // Proceed with spawning if coopmode is on + } + else + { + // Optionally, log or remove entity if coopmode is off + UTIL_Remove(this); + } Precache( ); SET_MODEL(ENT(pev), "models/bullsquid.mdl"); diff --git a/binary/dlls/controller.cpp b/binary/dlls/controller.cpp index 93df0df0..a85eb97e 100644 --- a/binary/dlls/controller.cpp +++ b/binary/dlls/controller.cpp @@ -359,6 +359,16 @@ void CController :: HandleAnimEvent( MonsterEvent_t *pEvent ) //========================================================= void CController :: Spawn() { + // Only spawn if coopmode is enabled + if (CVAR_GET_FLOAT("sv_aura_coop") == 1) + { + CBaseMonster::Spawn(); // Proceed with spawning if coopmode is on + } + else + { + // Optionally, log or remove entity if coopmode is off + UTIL_Remove(this); + } Precache( ); SET_MODEL(ENT(pev), "models/controller.mdl"); diff --git a/binary/dlls/gargantua.cpp b/binary/dlls/gargantua.cpp index 55bf0d50..a0d13bb0 100644 --- a/binary/dlls/gargantua.cpp +++ b/binary/dlls/gargantua.cpp @@ -749,6 +749,16 @@ void CGargantua :: SetYawSpeed ( void ) //========================================================= void CGargantua :: Spawn() { + // Only spawn if coopmode is enabled + if (CVAR_GET_FLOAT("sv_aura_coop") == 1) + { + CBaseMonster::Spawn(); // Proceed with spawning if coopmode is on + } + else + { + // Optionally, log or remove entity if coopmode is off + UTIL_Remove(this); + } Precache( ); SET_MODEL(ENT(pev), "models/garg.mdl"); diff --git a/binary/dlls/hassassin.cpp b/binary/dlls/hassassin.cpp index 9f2f25b7..ed999d78 100644 --- a/binary/dlls/hassassin.cpp +++ b/binary/dlls/hassassin.cpp @@ -279,6 +279,16 @@ void CHAssassin :: HandleAnimEvent( MonsterEvent_t *pEvent ) //========================================================= void CHAssassin :: Spawn() { + // Only spawn if coopmode is enabled + if (CVAR_GET_FLOAT("sv_aura_coop") == 1) + { + CBaseMonster::Spawn(); // Proceed with spawning if coopmode is on + } + else + { + // Optionally, log or remove entity if coopmode is off + UTIL_Remove(this); + } Precache( ); SET_MODEL(ENT(pev), "models/hassassin.mdl"); diff --git a/binary/dlls/headcrab.cpp b/binary/dlls/headcrab.cpp index 116532aa..c60a3549 100644 --- a/binary/dlls/headcrab.cpp +++ b/binary/dlls/headcrab.cpp @@ -277,6 +277,16 @@ void CHeadCrab :: HandleAnimEvent( MonsterEvent_t *pEvent ) //========================================================= void CHeadCrab :: Spawn() { + // Only spawn if coopmode is enabled + if (CVAR_GET_FLOAT("sv_aura_coop") == 1) + { + CBaseMonster::Spawn(); // Proceed with spawning if coopmode is on + } + else + { + // Optionally, log or remove entity if coopmode is off + UTIL_Remove(this); + } Precache( ); SET_MODEL(ENT(pev), "models/headcrab.mdl"); diff --git a/binary/dlls/hgrunt.cpp b/binary/dlls/hgrunt.cpp index 68711b04..f85be815 100644 --- a/binary/dlls/hgrunt.cpp +++ b/binary/dlls/hgrunt.cpp @@ -978,6 +978,16 @@ void CHGrunt :: HandleAnimEvent( MonsterEvent_t *pEvent ) //========================================================= void CHGrunt :: Spawn() { + // Only spawn if coopmode is enabled + if (CVAR_GET_FLOAT("sv_aura_coop") == 1) + { + CBaseMonster::Spawn(); // Proceed with spawning if coopmode is on + } + else + { + // Optionally, log or remove entity if coopmode is off + UTIL_Remove(this); + } Precache( ); SET_MODEL(ENT(pev), "models/hgrunt.mdl"); diff --git a/binary/dlls/houndeye.cpp b/binary/dlls/houndeye.cpp index 71f8301b..e66cba7f 100644 --- a/binary/dlls/houndeye.cpp +++ b/binary/dlls/houndeye.cpp @@ -328,6 +328,16 @@ void CHoundeye :: HandleAnimEvent( MonsterEvent_t *pEvent ) //========================================================= void CHoundeye :: Spawn() { + // Only spawn if coopmode is enabled + if (CVAR_GET_FLOAT("sv_aura_coop") == 1) + { + CBaseMonster::Spawn(); // Proceed with spawning if coopmode is on + } + else + { + // Optionally, log or remove entity if coopmode is off + UTIL_Remove(this); + } Precache( ); SET_MODEL(ENT(pev), "models/houndeye.mdl"); diff --git a/binary/dlls/ichthyosaur.cpp b/binary/dlls/ichthyosaur.cpp index 08708efa..0e458294 100644 --- a/binary/dlls/ichthyosaur.cpp +++ b/binary/dlls/ichthyosaur.cpp @@ -476,6 +476,16 @@ void CIchthyosaur :: HandleAnimEvent( MonsterEvent_t *pEvent ) //========================================================= void CIchthyosaur :: Spawn() { + // Only spawn if coopmode is enabled + if (CVAR_GET_FLOAT("sv_aura_coop") == 1) + { + CBaseMonster::Spawn(); // Proceed with spawning if coopmode is on + } + else + { + // Optionally, log or remove entity if coopmode is off + UTIL_Remove(this); + } Precache( ); SET_MODEL(ENT(pev), "models/icky.mdl"); diff --git a/binary/dlls/islave.cpp b/binary/dlls/islave.cpp index a56e8bee..2c94cffe 100644 --- a/binary/dlls/islave.cpp +++ b/binary/dlls/islave.cpp @@ -524,6 +524,16 @@ void CISlave :: StartTask ( Task_t *pTask ) //========================================================= void CISlave :: Spawn() { + // Only spawn if coopmode is enabled + if (CVAR_GET_FLOAT("sv_aura_coop") == 1) + { + CBaseMonster::Spawn(); // Proceed with spawning if coopmode is on + } + else + { + // Optionally, log or remove entity if coopmode is off + UTIL_Remove(this); + } Precache( ); SET_MODEL(ENT(pev), "models/islave.mdl"); diff --git a/binary/dlls/nihilanth.cpp b/binary/dlls/nihilanth.cpp index cdbf6d39..d7ce48d2 100644 --- a/binary/dlls/nihilanth.cpp +++ b/binary/dlls/nihilanth.cpp @@ -278,6 +278,16 @@ const char *CNihilanth::pDeathSounds[] = void CNihilanth :: Spawn( void ) { + // Only spawn if coopmode is enabled + if (CVAR_GET_FLOAT("sv_aura_coop") == 1) + { + CBaseMonster::Spawn(); // Proceed with spawning if coopmode is on + } + else + { + // Optionally, log or remove entity if coopmode is off + UTIL_Remove(this); + } Precache( ); // motor pev->movetype = MOVETYPE_FLY; diff --git a/binary/dlls/osprey.cpp b/binary/dlls/osprey.cpp index d85443bc..51fae127 100644 --- a/binary/dlls/osprey.cpp +++ b/binary/dlls/osprey.cpp @@ -144,6 +144,16 @@ IMPLEMENT_SAVERESTORE( COsprey, CBaseMonster ); void COsprey :: Spawn( void ) { + // Only spawn if coopmode is enabled + if (CVAR_GET_FLOAT("sv_aura_coop") == 1) + { + CBaseMonster::Spawn(); // Proceed with spawning if coopmode is on + } + else + { + // Optionally, log or remove entity if coopmode is off + UTIL_Remove(this); + } Precache( ); // motor pev->movetype = MOVETYPE_FLY; diff --git a/binary/dlls/tentacle.cpp b/binary/dlls/tentacle.cpp index de126dd4..6f94a9c5 100644 --- a/binary/dlls/tentacle.cpp +++ b/binary/dlls/tentacle.cpp @@ -249,6 +249,16 @@ int CTentacle :: Classify ( void ) // void CTentacle :: Spawn( ) { + // Only spawn if coopmode is enabled + if (CVAR_GET_FLOAT("sv_aura_coop") == 1) + { + CBaseMonster::Spawn(); // Proceed with spawning if coopmode is on + } + else + { + // Optionally, log or remove entity if coopmode is off + UTIL_Remove(this); + } Precache( ); pev->solid = SOLID_BBOX; diff --git a/binary/dlls/turret.cpp b/binary/dlls/turret.cpp index 33bf4ac8..0592d1c4 100644 --- a/binary/dlls/turret.cpp +++ b/binary/dlls/turret.cpp @@ -248,6 +248,16 @@ void CBaseTurret::KeyValue( KeyValueData *pkvd ) void CBaseTurret::Spawn() { + // Only spawn if coopmode is enabled + if (CVAR_GET_FLOAT("sv_aura_coop") == 1) + { + CBaseMonster::Spawn(); // Proceed with spawning if coopmode is on + } + else + { + // Optionally, log or remove entity if coopmode is off + UTIL_Remove(this); + } Precache( ); pev->nextthink = gpGlobals->time + 1; pev->movetype = MOVETYPE_FLY; diff --git a/binary/dlls/zamn.cpp b/binary/dlls/zamn.cpp index 90721fe8..bec3816a 100644 --- a/binary/dlls/zamn.cpp +++ b/binary/dlls/zamn.cpp @@ -262,6 +262,16 @@ void CZamnZombie::HandleAnimEvent(MonsterEvent_t* pEvent) //========================================================= void CZamnZombie::Spawn() { + // Only spawn if coopmode is enabled + if (CVAR_GET_FLOAT("sv_aura_coop") == 1) + { + CBaseMonster::Spawn(); // Proceed with spawning if coopmode is on + } + else + { + // Optionally, log or remove entity if coopmode is off + UTIL_Remove(this); + } Precache(); SET_MODEL(ENT(pev), "models/zamnzombie.mdl"); diff --git a/binary/dlls/zombie.cpp b/binary/dlls/zombie.cpp index fed84cad..258d06ed 100644 --- a/binary/dlls/zombie.cpp +++ b/binary/dlls/zombie.cpp @@ -271,6 +271,16 @@ void CZombie :: HandleAnimEvent( MonsterEvent_t *pEvent ) //========================================================= void CZombie :: Spawn() { + // Only spawn if coopmode is enabled + if (CVAR_GET_FLOAT("sv_aura_coop") == 1) + { + CBaseMonster::Spawn(); // Proceed with spawning if coopmode is on + } + else + { + // Optionally, log or remove entity if coopmode is off + UTIL_Remove(this); + } Precache( ); SET_MODEL(ENT(pev), "models/zombie.mdl");