mirror of
https://github.com/mapbase-source/source-sdk-2013.git
synced 2025-02-04 17:50:30 +03:00
Swap clientside weapon precache back to fix ammo not showing up correctly on HUD
This commit is contained in:
parent
9591e92fa1
commit
8729bebe5f
@ -151,13 +151,6 @@ int C_BaseCombatWeapon::GetWorldModelIndex( void )
|
||||
//-----------------------------------------------------------------------------
|
||||
void C_BaseCombatWeapon::OnDataChanged( DataUpdateType_t updateType )
|
||||
{
|
||||
#ifdef MAPBASE
|
||||
if (updateType == DATA_UPDATE_CREATED)
|
||||
{
|
||||
Precache();
|
||||
}
|
||||
#endif // MAPBASE
|
||||
|
||||
BaseClass::OnDataChanged(updateType);
|
||||
|
||||
CHandle< C_BaseCombatWeapon > handle = this;
|
||||
|
@ -23,6 +23,8 @@ public:
|
||||
|
||||
C_HLCustomWeaponMelee();
|
||||
|
||||
void OnDataChanged( DataUpdateType_t updateType );
|
||||
|
||||
virtual const char* GetWeaponScriptName() { return m_iszWeaponScriptName; }
|
||||
private:
|
||||
char m_iszWeaponScriptName[128];
|
||||
@ -39,6 +41,16 @@ C_HLCustomWeaponMelee::C_HLCustomWeaponMelee()
|
||||
m_iszWeaponScriptName[0] = '\0';
|
||||
}
|
||||
|
||||
void C_HLCustomWeaponMelee::OnDataChanged( DataUpdateType_t updateType )
|
||||
{
|
||||
if (updateType == DATA_UPDATE_CREATED)
|
||||
{
|
||||
Precache();
|
||||
}
|
||||
|
||||
BaseClass::OnDataChanged( updateType );
|
||||
}
|
||||
|
||||
|
||||
|
||||
class C_HLCustomWeaponGun : public C_BaseHLCombatWeapon
|
||||
@ -50,6 +62,8 @@ public:
|
||||
|
||||
C_HLCustomWeaponGun();
|
||||
|
||||
void OnDataChanged( DataUpdateType_t updateType );
|
||||
|
||||
virtual const char* GetWeaponScriptName() { return m_iszWeaponScriptName; }
|
||||
private:
|
||||
char m_iszWeaponScriptName[128];
|
||||
@ -64,4 +78,14 @@ END_RECV_TABLE();
|
||||
C_HLCustomWeaponGun::C_HLCustomWeaponGun()
|
||||
{
|
||||
m_iszWeaponScriptName[0] = '\0';
|
||||
}
|
||||
}
|
||||
|
||||
void C_HLCustomWeaponGun::OnDataChanged( DataUpdateType_t updateType )
|
||||
{
|
||||
if (updateType == DATA_UPDATE_CREATED)
|
||||
{
|
||||
Precache();
|
||||
}
|
||||
|
||||
BaseClass::OnDataChanged( updateType );
|
||||
}
|
||||
|
@ -164,9 +164,7 @@ void CBaseCombatWeapon::GiveDefaultAmmo( void )
|
||||
//-----------------------------------------------------------------------------
|
||||
void CBaseCombatWeapon::Spawn( void )
|
||||
{
|
||||
#if !defined(CLIENT_DLL) || !defined(MAPBASE)
|
||||
Precache();
|
||||
#endif // !defined(CLIENT_DLL) || !defined(MAPBASE)
|
||||
|
||||
BaseClass::Spawn();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user