From 41233cb475750a09e4a571909d069a9bb096a8be Mon Sep 17 00:00:00 2001 From: Wikot235 <149392035+Wikot235@users.noreply.github.com> Date: Sat, 27 Jul 2024 23:49:31 +0200 Subject: [PATCH] Added Melee attack keyvalue --- sp/src/game/server/hl2/npc_BaseZombie.cpp | 1 + sp/src/game/server/hl2/npc_BaseZombie.h | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/sp/src/game/server/hl2/npc_BaseZombie.cpp b/sp/src/game/server/hl2/npc_BaseZombie.cpp index f751d09a..1c5cde10 100644 --- a/sp/src/game/server/hl2/npc_BaseZombie.cpp +++ b/sp/src/game/server/hl2/npc_BaseZombie.cpp @@ -211,6 +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" ), #else DEFINE_FIELD( m_fIsHeadless, FIELD_BOOLEAN ), #endif diff --git a/sp/src/game/server/hl2/npc_BaseZombie.h b/sp/src/game/server/hl2/npc_BaseZombie.h index fb17f037..aa7541c1 100644 --- a/sp/src/game/server/hl2/npc_BaseZombie.h +++ b/sp/src/game/server/hl2/npc_BaseZombie.h @@ -20,8 +20,6 @@ #define ENVELOPE_CONTROLLER (CSoundEnvelopeController::GetController()) -#define ZOMBIE_MELEE_REACH 55 - extern int AE_ZOMBIE_ATTACK_RIGHT; extern int AE_ZOMBIE_ATTACK_LEFT; extern int AE_ZOMBIE_ATTACK_BOTH; @@ -141,7 +139,7 @@ public: } int MeleeAttack1Conditions ( float flDot, float flDist ); - virtual float GetClawAttackRange() const { return ZOMBIE_MELEE_REACH; } + virtual float GetClawAttackRange() const { return m_flMeleeReach; } // No range attacks int RangeAttack1Conditions ( float flDot, float flDist ) { return( 0 ); } @@ -257,6 +255,8 @@ protected: float m_flNextFlinch; + float m_flMeleeReach; + bool m_bHeadShot; // Used to determine the survival of our crab beyond our death. //