Skip to content

Commit 313417c

Browse files
committed
Fix weapon_equipped event not firing
1 parent 0781617 commit 313417c

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

src/game/server/basecombatcharacter.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2536,6 +2536,18 @@ void CBaseCombatCharacter::Weapon_HandleEquip( CBaseCombatWeapon *pWeapon )
25362536

25372537
//if (m_aliveTimer.IsLessThen(0.01f))
25382538
m_OnWeaponEquip.FireOutput(pWeapon, this);
2539+
2540+
if ( IsPlayer() )
2541+
{
2542+
IGameEvent *event = gameeventmanager->CreateEvent( "weapon_equipped" );
2543+
if ( event )
2544+
{
2545+
event->SetString( "class", pWeapon->GetClassname() );
2546+
event->SetInt( "entindex", pWeapon->entindex() );
2547+
event->SetInt( "owner_entindex", entindex() );
2548+
gameeventmanager->FireEvent( event );
2549+
}
2550+
}
25392551
}
25402552
#else
25412553
//-----------------------------------------------------------------------------

0 commit comments

Comments
 (0)