mirror of
https://github.com/mapbase-source/source-sdk-2013.git
synced 2025-03-03 17:25:27 +03:00
Fix prediction not selecting the correct weapon type
This commit is contained in:
parent
3265f840b6
commit
aab8755fcf
@ -855,7 +855,7 @@ void CPrediction::RunCommand( C_BasePlayer *player, CUserCmd *ucmd, IMoveHelper
|
||||
C_BaseCombatWeapon *weapon = dynamic_cast< C_BaseCombatWeapon * >( CBaseEntity::Instance( ucmd->weaponselect ) );
|
||||
if ( weapon )
|
||||
{
|
||||
player->SelectItem( weapon->GetClassname(), ucmd->weaponsubtype );
|
||||
player->SelectItem( weapon->GetName(), ucmd->weaponsubtype );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -93,6 +93,7 @@ public:
|
||||
virtual Activity GetPrimaryAttackActivity(void) { return m_CustomData.m_bHitUsesMissAnim ? ACT_VM_MISSCENTER : BaseClass::GetPrimaryAttackActivity(); }
|
||||
|
||||
const char* GetWeaponScriptName() { return m_iszWeaponScriptName.Get(); }
|
||||
const char* GetName( void ) const { return STRING( m_iClassname ); }
|
||||
virtual int GetDamageType() { return g_nDamageClassTypeBits[m_CustomData.m_nDamageClass]; }
|
||||
|
||||
virtual void InitCustomWeaponFromData(const void* pData, const char* pszWeaponScript);
|
||||
@ -381,6 +382,7 @@ public:
|
||||
CHLCustomWeaponGun();
|
||||
virtual void InitCustomWeaponFromData(const void* pData, const char* pszWeaponScript);
|
||||
const char* GetWeaponScriptName() { return m_iszWeaponScriptName.Get(); }
|
||||
const char* GetName( void ) const { return STRING( m_iClassname ); }
|
||||
|
||||
// Weapon behaviour
|
||||
virtual void ItemPostFrame(void); // called each frame by the player PostThink
|
||||
|
@ -393,7 +393,7 @@ void CPlayerMove::RunCommand ( CBasePlayer *player, CUserCmd *ucmd, IMoveHelper
|
||||
if ( weapon )
|
||||
{
|
||||
VPROF( "player->SelectItem()" );
|
||||
player->SelectItem( weapon->GetClassname(), ucmd->weaponsubtype );
|
||||
player->SelectItem( weapon->GetName(), ucmd->weaponsubtype );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -60,6 +60,7 @@ public:
|
||||
bool IsPredicted( void ) const { return m_iszClientScripts[0] != '\0'; }
|
||||
|
||||
const char* GetWeaponScriptName() { return m_iszWeaponScriptName[0] != '\0' ? m_iszWeaponScriptName : BaseClass::GetWeaponScriptName(); }
|
||||
const char* GetName() const { return m_iszWeaponScriptName[0] != '\0' ? STRING( m_iClassname ) : BaseClass::GetName(); }
|
||||
|
||||
// Weapon selection
|
||||
bool HasAnyAmmo( void ); // Returns true is weapon has ammo
|
||||
|
Loading…
x
Reference in New Issue
Block a user