Fixed miscellaneous things.

This commit is contained in:
Wikot235 2025-01-08 21:22:06 +01:00
parent 99c94f058b
commit 0921f7409b
2 changed files with 11 additions and 16 deletions

View File

@ -85,16 +85,9 @@ envelopePoint_t envDefaultZombieMoanVolume[] =
#define ZOMBIE_FARTHEST_PHYSICS_OBJECT 40.0*12.0 #define ZOMBIE_FARTHEST_PHYSICS_OBJECT 40.0*12.0
#define ZOMBIE_PHYSICS_SEARCH_DEPTH 100 #define ZOMBIE_PHYSICS_SEARCH_DEPTH 100
#ifndef MAPBASE
// Don't swat objects unless player is closer than this. // Don't swat objects unless player is closer than this.
#define ZOMBIE_PLAYER_MAX_SWAT_DIST 1000 #define ZOMBIE_PLAYER_MAX_SWAT_DIST 1000
// The heaviest physics object that a zombie should try to swat. (kg)
#define ZOMBIE_MAX_PHYSOBJ_MASS 60
#endif
// //
// How much health a Zombie torso gets when a whole zombie is broken // How much health a Zombie torso gets when a whole zombie is broken
// It's whole zombie's MAX Health * this value // It's whole zombie's MAX Health * this value
@ -105,6 +98,10 @@ envelopePoint_t envDefaultZombieMoanVolume[] =
// try to release its headcrab. // try to release its headcrab.
#define ZOMBIE_RELEASE_HEALTH_FACTOR 0.5 #define ZOMBIE_RELEASE_HEALTH_FACTOR 0.5
//
// The heaviest physics object that a zombie should try to swat. (kg)
#define ZOMBIE_MAX_PHYSOBJ_MASS 60
// //
// Zombie tries to get this close to a physics object's origin to swat it // Zombie tries to get this close to a physics object's origin to swat it
#define ZOMBIE_PHYSOBJ_SWATDIST 80 #define ZOMBIE_PHYSOBJ_SWATDIST 80
@ -216,7 +213,7 @@ BEGIN_DATADESC( CNPC_BaseZombie )
DEFINE_KEYFIELD( m_fIsHeadless, FIELD_BOOLEAN, "Headless" ), DEFINE_KEYFIELD( m_fIsHeadless, FIELD_BOOLEAN, "Headless" ),
DEFINE_KEYFIELD( m_iMeleeReach, FIELD_INTEGER, "MeleeReach" ), DEFINE_KEYFIELD( m_iMeleeReach, FIELD_INTEGER, "MeleeReach" ),
DEFINE_KEYFIELD( m_iMaxPlayerDistToSwat, FIELD_INTEGER, "MaxPlayerDistToSwat" ), DEFINE_KEYFIELD( m_iMaxPlayerDistToSwat, FIELD_INTEGER, "MaxPlayerDistToSwat" ),
DEFINE_KEYFIELD( m_iMaxObjWeightToSwat, FIELD_INTEGER, "MaxObjWeightToSwat" ), DEFINE_KEYFIELD( m_iMaxObjMassToSwat, FIELD_INTEGER, "MaxObjMassToSwat" ),
#else #else
DEFINE_FIELD( m_fIsHeadless, FIELD_BOOLEAN ), DEFINE_FIELD( m_fIsHeadless, FIELD_BOOLEAN ),
#endif #endif
@ -263,9 +260,9 @@ CNPC_BaseZombie::CNPC_BaseZombie()
m_iMoanSound = g_numZombies; m_iMoanSound = g_numZombies;
#ifdef MAPBASE #ifdef MAPBASE
m_iMeleeReach = 55; m_iMeleeReach = ZOMBIE_MELEE_REACH;
m_iMaxPlayerDistToSwat = 1000; m_iMaxPlayerDistToSwat = ZOMBIE_PLAYER_MAX_SWAT_DIST;
m_iMaxObjWeightToSwat = 60; m_iMaxObjMassToSwat = ZOMBIE_MAX_PHYSOBJ_MASS;
#endif #endif
g_numZombies++; g_numZombies++;
@ -2171,7 +2168,7 @@ void CNPC_BaseZombie::GatherConditions( void )
if( gpGlobals->curtime >= m_flNextSwatScan && (m_hPhysicsEnt == NULL) ) if( gpGlobals->curtime >= m_flNextSwatScan && (m_hPhysicsEnt == NULL) )
{ {
#ifdef MAPBASE #ifdef MAPBASE
FindNearestPhysicsObject( m_iMaxObjWeightToSwat ); FindNearestPhysicsObject(m_iMaxObjMassToSwat);
#else #else
FindNearestPhysicsObject( ZOMBIE_MAX_PHYSOBJ_MASS ); FindNearestPhysicsObject( ZOMBIE_MAX_PHYSOBJ_MASS );
#endif #endif

View File

@ -20,9 +20,7 @@
#define ENVELOPE_CONTROLLER (CSoundEnvelopeController::GetController()) #define ENVELOPE_CONTROLLER (CSoundEnvelopeController::GetController())
#ifndef MAPBASE
#define ZOMBIE_MELEE_REACH 55 #define ZOMBIE_MELEE_REACH 55
#endif
extern int AE_ZOMBIE_ATTACK_RIGHT; extern int AE_ZOMBIE_ATTACK_RIGHT;
extern int AE_ZOMBIE_ATTACK_LEFT; extern int AE_ZOMBIE_ATTACK_LEFT;
@ -270,7 +268,7 @@ protected:
#ifdef MAPBASE #ifdef MAPBASE
int m_iMeleeReach; int m_iMeleeReach;
int m_iMaxPlayerDistToSwat; int m_iMaxPlayerDistToSwat;
int m_iMaxObjWeightToSwat; int m_iMaxObjMassToSwat;
#endif #endif
bool m_bHeadShot; // Used to determine the survival of our crab beyond our death. bool m_bHeadShot; // Used to determine the survival of our crab beyond our death.