mirror of
https://github.com/mapbase-source/source-sdk-2013.git
synced 2025-01-13 15:27:56 +03:00
Fixed reloading for certain weapons on certain NPCs
This commit is contained in:
parent
6d04c46dc0
commit
7702ce96d4
@ -2339,6 +2339,27 @@ bool CBaseCombatWeapon::Reload( void )
|
||||
return DefaultReload( GetMaxClip1(), GetMaxClip2(), ACT_VM_RELOAD );
|
||||
}
|
||||
|
||||
#ifdef MAPBASE
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose:
|
||||
//-----------------------------------------------------------------------------
|
||||
void CBaseCombatWeapon::Reload_NPC( void )
|
||||
{
|
||||
WeaponSound( RELOAD_NPC );
|
||||
|
||||
if (UsesClipsForAmmo1())
|
||||
{
|
||||
m_iClip1 = GetMaxClip1();
|
||||
}
|
||||
else
|
||||
{
|
||||
// For weapons which don't use clips, give the owner ammo.
|
||||
if (GetOwner())
|
||||
GetOwner()->SetAmmoCount( GetDefaultClip1(), m_iPrimaryAmmoType );
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
//=========================================================
|
||||
void CBaseCombatWeapon::WeaponIdle( void )
|
||||
{
|
||||
|
@ -319,7 +319,7 @@ public:
|
||||
bool ReloadsSingly( void ) const;
|
||||
#ifdef MAPBASE
|
||||
// Originally created for the crossbow, can be used to add special NPC reloading behavior
|
||||
virtual void Reload_NPC( void ) { WeaponSound(RELOAD_NPC); m_iClip1 = GetMaxClip1(); }
|
||||
virtual void Reload_NPC( void );
|
||||
#endif
|
||||
|
||||
virtual bool AutoFiresFullClip( void ) { return false; }
|
||||
|
Loading…
x
Reference in New Issue
Block a user