mirror of
https://github.com/mapbase-source/source-sdk-2013.git
synced 2025-01-12 23:07:55 +03:00
Fixed custom weapon scripts on client
This commit is contained in:
parent
332856e37e
commit
f58b599020
@ -151,6 +151,13 @@ 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;
|
||||
|
@ -164,7 +164,9 @@ void CBaseCombatWeapon::GiveDefaultAmmo( void )
|
||||
//-----------------------------------------------------------------------------
|
||||
void CBaseCombatWeapon::Spawn( void )
|
||||
{
|
||||
#if !defined(CLIENT_DLL) || !defined(MAPBASE)
|
||||
Precache();
|
||||
#endif // !defined(CLIENT_DLL) || !defined(MAPBASE)
|
||||
|
||||
BaseClass::Spawn();
|
||||
|
||||
@ -239,7 +241,7 @@ const unsigned char *CBaseCombatWeapon::GetEncryptionKey( void )
|
||||
void CBaseCombatWeapon::Precache( void )
|
||||
{
|
||||
#if defined( CLIENT_DLL )
|
||||
Assert( Q_strlen( GetClassname() ) > 0 );
|
||||
Assert( Q_strlen(GetWeaponScriptName() ) > 0 );
|
||||
// Msg( "Client got %s\n", GetClassname() );
|
||||
#endif
|
||||
m_iPrimaryAmmoType = m_iSecondaryAmmoType = -1;
|
||||
@ -321,7 +323,7 @@ void CBaseCombatWeapon::Precache( void )
|
||||
else
|
||||
{
|
||||
// Couldn't read data file, remove myself
|
||||
Warning( "Error reading weapon data file for: %s\n", GetClassname() );
|
||||
Warning( "Error reading weapon data file for: %s\n", GetWeaponScriptName() );
|
||||
// Remove( ); //don't remove, this gets released soon!
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user