Fixed issues with unique cases in companion readiness

This commit is contained in:
Blixibon 2021-11-18 23:23:09 -06:00
parent 7dab039099
commit 013da89b27
2 changed files with 21 additions and 4 deletions

View File

@ -1956,10 +1956,9 @@ bool CNPC_PlayerCompanion::IsReadinessCapable()
{
// Rather than looking up the activity string, we just make sure our weapon accepts a few basic readiness activity overrides.
// This lets us make sure our weapon is readiness-capable to begin with.
CBaseCombatWeapon *pWeapon = GetActiveWeapon();
if ( pWeapon->ActivityOverride(ACT_IDLE_RELAXED, NULL) == ACT_IDLE_RELAXED &&
pWeapon->ActivityOverride( ACT_IDLE_STIMULATED, NULL ) == ACT_IDLE_STIMULATED &&
pWeapon->ActivityOverride( ACT_IDLE_AGITATED, NULL ) == ACT_IDLE_AGITATED )
if ( TranslateActivity( ACT_IDLE_RELAXED ) == ACT_IDLE_RELAXED &&
TranslateActivity( ACT_IDLE_STIMULATED ) == ACT_IDLE_STIMULATED &&
TranslateActivity( ACT_IDLE_AGITATED ) == ACT_IDLE_AGITATED )
return false;
if (LookupActivity( "ACT_IDLE_AIM_RIFLE_STIMULATED" ) == ACT_INVALID)
@ -2797,6 +2796,21 @@ void CNPC_PlayerCompanion::Weapon_Equip( CBaseCombatWeapon *pWeapon )
m_bReadinessCapable = IsReadinessCapable();
}
#ifdef MAPBASE
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
bool CNPC_PlayerCompanion::DoUnholster()
{
if ( BaseClass::DoUnholster() )
{
m_bReadinessCapable = IsReadinessCapable();
return true;
}
return false;
}
#endif
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void CNPC_PlayerCompanion::PickupWeapon( CBaseCombatWeapon *pWeapon )

View File

@ -282,6 +282,9 @@ public:
bool ShouldLookForBetterWeapon();
bool Weapon_CanUse( CBaseCombatWeapon *pWeapon );
void Weapon_Equip( CBaseCombatWeapon *pWeapon );
#ifdef MAPBASE
bool DoUnholster( void );
#endif
void PickupWeapon( CBaseCombatWeapon *pWeapon );
#if COMPANION_MELEE_ATTACK