From 9b5bfd8cd2b40f29959b0b306ef428effa3053aa Mon Sep 17 00:00:00 2001 From: Andrey Akhmichin Date: Sun, 11 Oct 2020 16:50:09 +0500 Subject: [PATCH] Fix https://github.com/FWGS/hlsdk-xash3d/issues/131 --- dlls/hunger/chaingun.cpp | 12 ++++++++++++ dlls/weapons.h | 1 + 2 files changed, 13 insertions(+) diff --git a/dlls/hunger/chaingun.cpp b/dlls/hunger/chaingun.cpp index ad2bc255..2e55abf0 100644 --- a/dlls/hunger/chaingun.cpp +++ b/dlls/hunger/chaingun.cpp @@ -88,6 +88,18 @@ int CWeaponEinarChaingun::GetItemInfo( ItemInfo *p ) return 1; } +int CWeaponEinarChaingun::AddToPlayer( CBasePlayer *pPlayer ) +{ + if( CBasePlayerWeapon::AddToPlayer( pPlayer ) ) + { + MESSAGE_BEGIN( MSG_ONE, gmsgWeapPickup, NULL, pPlayer->pev ); + WRITE_BYTE( m_iId ); + MESSAGE_END(); + return TRUE; + } + return FALSE; +} + BOOL CWeaponEinarChaingun::Deploy() { return DefaultDeploy( "models/v_tfac.mdl", "models/p_tfac.mdl", CHAINGUN_DRAW, "egon" ); diff --git a/dlls/weapons.h b/dlls/weapons.h index ee3333e8..96df0be2 100644 --- a/dlls/weapons.h +++ b/dlls/weapons.h @@ -1206,6 +1206,7 @@ public: void Spawn(); void Precache(); int iItemSlot() { return 4; } + int AddToPlayer( CBasePlayer *pPlayer ); int GetItemInfo(ItemInfo *p); void PrimaryAttack();