From 4c19cb7c8cfce5268b0642868d80ac9d442a66f6 Mon Sep 17 00:00:00 2001 From: Andrey Akhmichin Date: Sun, 11 Oct 2020 17:18:05 +0500 Subject: [PATCH] Fix https://github.com/FWGS/hlsdk-xash3d/issues/132 --- dlls/hunger/medkit.cpp | 12 ++++++++++++ dlls/weapons.h | 1 + 2 files changed, 13 insertions(+) diff --git a/dlls/hunger/medkit.cpp b/dlls/hunger/medkit.cpp index 3ce116b6..24ff1717 100644 --- a/dlls/hunger/medkit.cpp +++ b/dlls/hunger/medkit.cpp @@ -72,6 +72,18 @@ int CWeaponEinarMedkit::GetItemInfo( ItemInfo *p ) return 1; } +int CWeaponEinarMedkit::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 CWeaponEinarMedkit::Deploy() { return DefaultDeploy( "models/v_tfc_medkit.mdl", "models/p_tfc_medkit.mdl", MEDKIT_DRAW, "trip" ); diff --git a/dlls/weapons.h b/dlls/weapons.h index 96df0be2..ff937bb0 100644 --- a/dlls/weapons.h +++ b/dlls/weapons.h @@ -1248,6 +1248,7 @@ public: void Spawn(); void Precache(); int iItemSlot() { return 5; } + int AddToPlayer( CBasePlayer *pPlayer ); int GetItemInfo( ItemInfo *p ); void PrimaryAttack();