From 13f422f4c42d4c7613538ddd4bf766f65be258b0 Mon Sep 17 00:00:00 2001 From: Peter Covington Date: Tue, 19 Apr 2022 00:57:05 -0400 Subject: [PATCH] Fix issues --- sp/src/game/client/mapbase/c_weapon_custom_hl2.cpp | 4 ++-- sp/src/game/server/mapbase/weapon_custom_hl2.cpp | 7 ++++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/sp/src/game/client/mapbase/c_weapon_custom_hl2.cpp b/sp/src/game/client/mapbase/c_weapon_custom_hl2.cpp index 8c89f2d7..9f97a12f 100644 --- a/sp/src/game/client/mapbase/c_weapon_custom_hl2.cpp +++ b/sp/src/game/client/mapbase/c_weapon_custom_hl2.cpp @@ -33,10 +33,10 @@ C_HLCustomWeaponMelee::C_HLCustomWeaponMelee() -class C_HLCustomWeaponGun : public C_BaseHLBludgeonWeapon +class C_HLCustomWeaponGun : public C_BaseHLCombatWeapon { public: - DECLARE_CLASS(C_HLCustomWeaponGun, C_BaseHLBludgeonWeapon); + DECLARE_CLASS(C_HLCustomWeaponGun, C_BaseHLCombatWeapon); DECLARE_CLIENTCLASS(); DECLARE_PREDICTABLE(); diff --git a/sp/src/game/server/mapbase/weapon_custom_hl2.cpp b/sp/src/game/server/mapbase/weapon_custom_hl2.cpp index c2881c6f..7a374386 100644 --- a/sp/src/game/server/mapbase/weapon_custom_hl2.cpp +++ b/sp/src/game/server/mapbase/weapon_custom_hl2.cpp @@ -354,6 +354,7 @@ public: CHLCustomWeaponGun(); virtual void ParseCustomFromWeaponFile(const char* pFileName); + const char* GetWeaponScriptName() { return m_iszWeaponScriptName.Get(); } // Weapon behaviour virtual void ItemPostFrame(void); // called each frame by the player PostThink @@ -672,9 +673,9 @@ void CHLCustomWeaponGun::ParseCustomFromWeaponFile(const char* pFileName) float flSpread = pkvData->GetFloat("spread", 5.f); float flNPCSpread = pkvData->GetFloat("spread_npc", flSpread); float flAllySperad = pkvData->GetFloat("spread_ally", flNPCSpread); - m_vPlayerSpread = Vector(sin(flSpread * 0.5f)); - m_vNPCSpread = Vector(sin(flNPCSpread * 0.5f)); - m_vAllySpread = Vector(sin(flAllySperad * 0.5f)); + m_vPlayerSpread = Vector(sin(DEG2RAD(flSpread * 0.5f))); + m_vNPCSpread = Vector(sin(DEG2RAD(flNPCSpread * 0.5f))); + m_vAllySpread = Vector(sin(DEG2RAD(flAllySperad * 0.5f))); const char* pszAnimType = pkvData->GetString("anim_type", nullptr); if (pszAnimType)