Skip to content

Commit 0921f74

Browse files
committed
Fixed miscellaneous things.
1 parent 99c94f0 commit 0921f74

File tree

2 files changed

+11
-16
lines changed

2 files changed

+11
-16
lines changed

sp/src/game/server/hl2/npc_BaseZombie.cpp

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -85,16 +85,9 @@ envelopePoint_t envDefaultZombieMoanVolume[] =
8585
#define ZOMBIE_FARTHEST_PHYSICS_OBJECT 40.0*12.0
8686
#define ZOMBIE_PHYSICS_SEARCH_DEPTH 100
8787

88-
#ifndef MAPBASE
89-
9088
// Don't swat objects unless player is closer than this.
9189
#define ZOMBIE_PLAYER_MAX_SWAT_DIST 1000
9290

93-
// The heaviest physics object that a zombie should try to swat. (kg)
94-
#define ZOMBIE_MAX_PHYSOBJ_MASS 60
95-
96-
#endif
97-
9891
//
9992
// How much health a Zombie torso gets when a whole zombie is broken
10093
// It's whole zombie's MAX Health * this value
@@ -105,6 +98,10 @@ envelopePoint_t envDefaultZombieMoanVolume[] =
10598
// try to release its headcrab.
10699
#define ZOMBIE_RELEASE_HEALTH_FACTOR 0.5
107100

101+
//
102+
// The heaviest physics object that a zombie should try to swat. (kg)
103+
#define ZOMBIE_MAX_PHYSOBJ_MASS 60
104+
108105
//
109106
// Zombie tries to get this close to a physics object's origin to swat it
110107
#define ZOMBIE_PHYSOBJ_SWATDIST 80
@@ -216,7 +213,7 @@ BEGIN_DATADESC( CNPC_BaseZombie )
216213
DEFINE_KEYFIELD( m_fIsHeadless, FIELD_BOOLEAN, "Headless" ),
217214
DEFINE_KEYFIELD( m_iMeleeReach, FIELD_INTEGER, "MeleeReach" ),
218215
DEFINE_KEYFIELD( m_iMaxPlayerDistToSwat, FIELD_INTEGER, "MaxPlayerDistToSwat" ),
219-
DEFINE_KEYFIELD( m_iMaxObjWeightToSwat, FIELD_INTEGER, "MaxObjWeightToSwat" ),
216+
DEFINE_KEYFIELD( m_iMaxObjMassToSwat, FIELD_INTEGER, "MaxObjMassToSwat" ),
220217
#else
221218
DEFINE_FIELD( m_fIsHeadless, FIELD_BOOLEAN ),
222219
#endif
@@ -263,9 +260,9 @@ CNPC_BaseZombie::CNPC_BaseZombie()
263260
m_iMoanSound = g_numZombies;
264261

265262
#ifdef MAPBASE
266-
m_iMeleeReach = 55;
267-
m_iMaxPlayerDistToSwat = 1000;
268-
m_iMaxObjWeightToSwat = 60;
263+
m_iMeleeReach = ZOMBIE_MELEE_REACH;
264+
m_iMaxPlayerDistToSwat = ZOMBIE_PLAYER_MAX_SWAT_DIST;
265+
m_iMaxObjMassToSwat = ZOMBIE_MAX_PHYSOBJ_MASS;
269266
#endif
270267

271268
g_numZombies++;
@@ -2171,7 +2168,7 @@ void CNPC_BaseZombie::GatherConditions( void )
21712168
if( gpGlobals->curtime >= m_flNextSwatScan && (m_hPhysicsEnt == NULL) )
21722169
{
21732170
#ifdef MAPBASE
2174-
FindNearestPhysicsObject( m_iMaxObjWeightToSwat );
2171+
FindNearestPhysicsObject(m_iMaxObjMassToSwat);
21752172
#else
21762173
FindNearestPhysicsObject( ZOMBIE_MAX_PHYSOBJ_MASS );
21772174
#endif

sp/src/game/server/hl2/npc_BaseZombie.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,7 @@
2020

2121
#define ENVELOPE_CONTROLLER (CSoundEnvelopeController::GetController())
2222

23-
#ifndef MAPBASE
24-
#define ZOMBIE_MELEE_REACH 55
25-
#endif
23+
#define ZOMBIE_MELEE_REACH 55
2624

2725
extern int AE_ZOMBIE_ATTACK_RIGHT;
2826
extern int AE_ZOMBIE_ATTACK_LEFT;
@@ -270,7 +268,7 @@ abstract_class CNPC_BaseZombie : public CAI_BaseZombieBase
270268
#ifdef MAPBASE
271269
int m_iMeleeReach;
272270
int m_iMaxPlayerDistToSwat;
273-
int m_iMaxObjWeightToSwat;
271+
int m_iMaxObjMassToSwat;
274272
#endif
275273

276274
bool m_bHeadShot; // Used to determine the survival of our crab beyond our death.

0 commit comments

Comments
 (0)