@@ -211,6 +211,9 @@ BEGIN_DATADESC( CNPC_BaseZombie )
211211 DEFINE_FIELD( m_fIsTorso, FIELD_BOOLEAN ),
212212#ifdef MAPBASE
213213 DEFINE_KEYFIELD ( m_fIsHeadless, FIELD_BOOLEAN, " Headless" ),
214+ DEFINE_KEYFIELD( m_flMeleeReach, FIELD_FLOAT, " MeleeReach" ),
215+ DEFINE_KEYFIELD( m_flMaxDistToSwat, FIELD_FLOAT, " MaxDistToSwat" ),
216+ DEFINE_KEYFIELD( m_iMaxObjMassToSwat, FIELD_INTEGER, " MaxObjMassToSwat" ),
214217#else
215218 DEFINE_FIELD ( m_fIsHeadless, FIELD_BOOLEAN ),
216219#endif
@@ -256,6 +259,12 @@ CNPC_BaseZombie::CNPC_BaseZombie()
256259 // moan loop.
257260 m_iMoanSound = g_numZombies;
258261
262+ #ifdef MAPBASE
263+ m_flMeleeReach = ZOMBIE_MELEE_REACH;
264+ m_flMaxDistToSwat = ZOMBIE_PLAYER_MAX_SWAT_DIST;
265+ m_iMaxObjMassToSwat = ZOMBIE_MAX_PHYSOBJ_MASS;
266+ #endif
267+
259268 g_numZombies++;
260269}
261270
@@ -295,7 +304,11 @@ bool CNPC_BaseZombie::FindNearestPhysicsObject( int iMaxMass )
295304 float dist = VectorNormalize (vecDirToEnemy);
296305 vecDirToEnemy.z = 0 ;
297306
298- if ( dist > ZOMBIE_PLAYER_MAX_SWAT_DIST )
307+ #ifndef MAPBASE
308+ if (dist > ZOMBIE_PLAYER_MAX_SWAT_DIST)
309+ #else
310+ if (dist > m_flMaxDistToSwat)
311+ #endif
299312 {
300313 // Player is too far away. Don't bother
301314 // trying to swat anything at them until
@@ -786,7 +799,7 @@ bool CNPC_BaseZombie::ShouldBecomeTorso( const CTakeDamageInfo &info, float flDa
786799HeadcrabRelease_t CNPC_BaseZombie::ShouldReleaseHeadcrab ( const CTakeDamageInfo &info, float flDamageThreshold )
787800{
788801#ifdef MAPBASE
789- if ( m_iHealth <= 0 && !m_fIsHeadless )
802+ if ( m_iHealth <= 0 && !m_fIsHeadless && ! HasSpawnFlags (SF_ZOMBIE_NO_HEADCRAB_SPAWN) )
790803#else
791804 if ( m_iHealth <= 0 )
792805#endif
@@ -2154,7 +2167,11 @@ void CNPC_BaseZombie::GatherConditions( void )
21542167 // between him and the object he's heading for already.
21552168 if ( gpGlobals->curtime >= m_flNextSwatScan && (m_hPhysicsEnt == NULL ) )
21562169 {
2170+ #ifdef MAPBASE
2171+ FindNearestPhysicsObject (m_iMaxObjMassToSwat);
2172+ #else
21572173 FindNearestPhysicsObject ( ZOMBIE_MAX_PHYSOBJ_MASS );
2174+ #endif
21582175 m_flNextSwatScan = gpGlobals->curtime + 2.0 ;
21592176 }
21602177 }
0 commit comments