mirror of
https://github.com/YGGverse/hlsdk-portable.git
synced 2025-01-23 21:24:27 +00:00
Merge ee1ec9d64f
This commit is contained in:
parent
73a99df894
commit
38b2236515
@ -2583,11 +2583,10 @@ void CBasePlayer::PostThink()
|
||||
CheckPowerups( pev );
|
||||
|
||||
UpdatePlayerSound();
|
||||
|
||||
pt_end:
|
||||
// Track button info so we can detect 'pressed' and 'released' buttons next frame
|
||||
m_afButtonLast = pev->button;
|
||||
|
||||
pt_end:
|
||||
#if defined( CLIENT_WEAPONS )
|
||||
// Decay timers on weapons
|
||||
// go through all of the weapons and make a list of the ones to pack
|
||||
@ -4061,6 +4060,52 @@ void CBasePlayer::UpdateClientData( void )
|
||||
m_rgpPlayerItems[i]->UpdateClientData( this );
|
||||
}
|
||||
|
||||
if( m_pClientActiveItem != pPlayer->m_pActiveItem )
|
||||
{
|
||||
if( pPlayer->m_pActiveItem == NULL )
|
||||
{
|
||||
// If no weapon, we have to send update here
|
||||
CBasePlayer *plr;
|
||||
for( int i = 1; i <= gpGlobals->maxClients; i++ )
|
||||
{
|
||||
plr = (CBasePlayer *)UTIL_PlayerByIndex( i );
|
||||
if( !plr || !plr->IsObserver() || plr->m_hObserverTarget != pPlayer )
|
||||
continue;
|
||||
|
||||
MESSAGE_BEGIN( MSG_ONE, gmsgCurWeapon, NULL, plr->pev );
|
||||
WRITE_BYTE( 0 );
|
||||
WRITE_BYTE( 0 );
|
||||
WRITE_BYTE( 0 );
|
||||
MESSAGE_END();
|
||||
}
|
||||
|
||||
MESSAGE_BEGIN( MSG_ONE, gmsgCurWeapon, NULL, pPlayer->pev );
|
||||
WRITE_BYTE( 0 );
|
||||
WRITE_BYTE( 0 );
|
||||
WRITE_BYTE( 0 );
|
||||
MESSAGE_END();
|
||||
}
|
||||
else if( this != pPlayer )
|
||||
{
|
||||
// Special case for spectator
|
||||
CBasePlayerWeapon *gun = (CBasePlayerWeapon *)pPlayer->m_pActiveItem->GetWeaponPtr();
|
||||
if( gun )
|
||||
{
|
||||
int state;
|
||||
if( pPlayer->m_fOnTarget )
|
||||
state = WEAPON_IS_ONTARGET;
|
||||
else
|
||||
state = 1;
|
||||
|
||||
MESSAGE_BEGIN( MSG_ONE, gmsgCurWeapon, NULL, pev );
|
||||
WRITE_BYTE( state );
|
||||
WRITE_BYTE( gun->m_iId );
|
||||
WRITE_BYTE( gun->m_iClip );
|
||||
MESSAGE_END();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Cache and client weapon change
|
||||
m_pClientActiveItem = m_pActiveItem;
|
||||
m_iClientFOV = m_iFOV;
|
||||
|
Loading…
x
Reference in New Issue
Block a user