From 7e5145aaff6dbb0d734acb66a97c9e7247e21402 Mon Sep 17 00:00:00 2001 From: Night Owl Date: Mon, 17 Jul 2017 13:03:38 +0500 Subject: [PATCH] Merge https://github.com/LevShisterov/BugfixedHL/commit/b15a0f9d564d6f8e793617ebc88b41cd6940d90c --- dlls/crowbar.cpp | 12 ++++++++++++ dlls/glock.cpp | 12 ++++++++++++ dlls/weapons.h | 6 ++++-- 3 files changed, 28 insertions(+), 2 deletions(-) diff --git a/dlls/crowbar.cpp b/dlls/crowbar.cpp index 98808e14..f9a91978 100644 --- a/dlls/crowbar.cpp +++ b/dlls/crowbar.cpp @@ -80,6 +80,18 @@ int CCrowbar::GetItemInfo( ItemInfo *p ) return 1; } +int CCrowbar::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 CCrowbar::Deploy() { return DefaultDeploy( "models/v_crowbar.mdl", "models/p_crowbar.mdl", CROWBAR_DRAW, "crowbar" ); diff --git a/dlls/glock.cpp b/dlls/glock.cpp index 3eb08d6c..1150d8b9 100644 --- a/dlls/glock.cpp +++ b/dlls/glock.cpp @@ -86,6 +86,18 @@ int CGlock::GetItemInfo( ItemInfo *p ) return 1; } +int CGlock::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 CGlock::Deploy() { // pev->body = 1; diff --git a/dlls/weapons.h b/dlls/weapons.h index 3d8dd6ad..f48767c8 100644 --- a/dlls/weapons.h +++ b/dlls/weapons.h @@ -463,7 +463,8 @@ public: void Spawn( void ); void Precache( void ); int iItemSlot( void ) { return 2; } - int GetItemInfo(ItemInfo *p); + int GetItemInfo( ItemInfo *p ); + int AddToPlayer( CBasePlayer *pPlayer ); void PrimaryAttack( void ); void SecondaryAttack( void ); @@ -496,7 +497,8 @@ public: int iItemSlot( void ) { return 1; } void EXPORT SwingAgain( void ); void EXPORT Smack( void ); - int GetItemInfo(ItemInfo *p); + int GetItemInfo( ItemInfo *p ); + int AddToPlayer( CBasePlayer *pPlayer ); void PrimaryAttack( void ); int Swing( int fFirst );