本文整理汇总了C++中CBasePlayerWeapon::IsPredicted方法的典型用法代码示例。如果您正苦于以下问题:C++ CBasePlayerWeapon::IsPredicted方法的具体用法?C++ CBasePlayerWeapon::IsPredicted怎么用?C++ CBasePlayerWeapon::IsPredicted使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CBasePlayerWeapon
的用法示例。
在下文中一共展示了CBasePlayerWeapon::IsPredicted方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: PostThink
//.........这里部分代码省略.........
}
if( IsAlive() )
{
SetAnimation( PLAYER_WALK );
}
}
if( GetFlags().Any( FL_ONGROUND ) )
{
if( m_flFallVelocity > 64 && !g_pGameRules->IsMultiplayer() )
{
CSoundEnt::InsertSound( bits_SOUND_PLAYER, GetAbsOrigin(), m_flFallVelocity, 0.2 );
// ALERT( at_console, "fall %f\n", m_flFallVelocity );
}
m_flFallVelocity = 0;
}
// select the proper animation for the player character
if( IsAlive() )
{
if( !GetAbsVelocity().x && !GetAbsVelocity().y )
SetAnimation( PLAYER_IDLE );
else if( ( GetAbsVelocity().x || GetAbsVelocity().y ) && ( GetFlags().Any( FL_ONGROUND ) ) )
SetAnimation( PLAYER_WALK );
else if( GetWaterLevel() > WATERLEVEL_FEET )
SetAnimation( PLAYER_WALK );
}
StudioFrameAdvance();
CheckPowerups( this );
UpdatePlayerSound();
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
for( int i = 0; i < MAX_WEAPON_SLOTS; i++ )
{
if( m_rgpPlayerItems[ i ] )
{
CBasePlayerWeapon *pPlayerItem = m_rgpPlayerItems[ i ];
while( pPlayerItem )
{
if( pPlayerItem->IsPredicted() )
{
pPlayerItem->m_flNextPrimaryAttack = max( pPlayerItem->m_flNextPrimaryAttack - gpGlobals->frametime, -1.0f );
pPlayerItem->m_flNextSecondaryAttack = max( pPlayerItem->m_flNextSecondaryAttack - gpGlobals->frametime, -0.001f );
if( pPlayerItem->m_flTimeWeaponIdle != 1000 )
{
pPlayerItem->m_flTimeWeaponIdle = max( pPlayerItem->m_flTimeWeaponIdle - gpGlobals->frametime, -0.001f );
}
if( pPlayerItem->pev->fuser1 != 1000 )
{
pPlayerItem->pev->fuser1 = max( pPlayerItem->pev->fuser1 - gpGlobals->frametime, -0.001f );
}
pPlayerItem->DecrementTimers( gpGlobals->frametime );
// Only decrement if not flagged as NO_DECREMENT
// if ( gun->m_flPumpTime != 1000 )
// {
// gun->m_flPumpTime = max( gun->m_flPumpTime - gpGlobals->frametime, -0.001 );
// }
}
pPlayerItem = pPlayerItem->m_pNext;
}
}
}
m_flNextAttack -= gpGlobals->frametime;
if( m_flNextAttack < -0.001 )
m_flNextAttack = -0.001;
if( m_flNextAmmoBurn != 1000 )
{
m_flNextAmmoBurn -= gpGlobals->frametime;
if( m_flNextAmmoBurn < -0.001 )
m_flNextAmmoBurn = -0.001;
}
if( m_flAmmoStartCharge != 1000 )
{
m_flAmmoStartCharge -= gpGlobals->frametime;
if( m_flAmmoStartCharge < -0.001 )
m_flAmmoStartCharge = -0.001;
}
#endif
// Track button info so we can detect 'pressed' and 'released' buttons next frame
m_afButtonLast = GetButtons().Get();
}