m_iMeleeReach now defaults to 55

This commit is contained in:
Wikot235 2025-01-05 16:13:16 +01:00
parent a736b0f96a
commit 959af0b130
2 changed files with 22 additions and 5 deletions

View File

@ -211,7 +211,7 @@ BEGIN_DATADESC( CNPC_BaseZombie )
DEFINE_FIELD( m_fIsTorso, FIELD_BOOLEAN ),
#ifdef MAPBASE
DEFINE_KEYFIELD( m_fIsHeadless, FIELD_BOOLEAN, "Headless" ),
DEFINE_KEYFIELD( m_flMeleeReach, FIELD_FLOAT, "MeleeReach" ),
DEFINE_KEYFIELD( m_iMeleeReach, FIELD_INTEGER, "MeleeReach" ),
#else
DEFINE_FIELD( m_fIsHeadless, FIELD_BOOLEAN ),
#endif
@ -257,6 +257,10 @@ CNPC_BaseZombie::CNPC_BaseZombie()
// moan loop.
m_iMoanSound = g_numZombies;
#ifdef MAPBASE
m_iMeleeReach = 55;
#endif
g_numZombies++;
}

View File

@ -20,6 +20,10 @@
#define ENVELOPE_CONTROLLER (CSoundEnvelopeController::GetController())
#ifndef MAPBASE
#define ZOMBIE_MELEE_REACH 55
#endif
extern int AE_ZOMBIE_ATTACK_RIGHT;
extern int AE_ZOMBIE_ATTACK_LEFT;
extern int AE_ZOMBIE_ATTACK_BOTH;
@ -42,8 +46,8 @@ extern int AE_ZOMBIE_POUND;
#define ZOMBIE_BLOOD_BITE 3
#ifdef MAPBASE
#define SF_ZOMBIE_NO_TORSO ( 1 << 15 )
#define SF_ZOMBIE_NO_HEADCRAB_SPAWN ( 1 << 16 )
#define SF_ZOMBIE_NO_TORSO ( 1 << 15 )
#define SF_ZOMBIE_NO_HEADCRAB_SPAWN ( 1 << 16 )
#endif
@ -140,7 +144,14 @@ public:
}
int MeleeAttack1Conditions ( float flDot, float flDist );
virtual float GetClawAttackRange() const { return m_flMeleeReach; }
virtual float GetClawAttackRange() const
{
#ifdef MAPBASE
return m_iMeleeReach;
#else
return ZOMBIE_MELEE_REACH;
#endif
}
// No range attacks
int RangeAttack1Conditions ( float flDot, float flDist ) { return( 0 ); }
@ -256,7 +267,9 @@ protected:
float m_flNextFlinch;
float m_flMeleeReach;
#ifdef MAPBASE
int m_iMeleeReach;
#endif
bool m_bHeadShot; // Used to determine the survival of our crab beyond our death.