Fixed an issue with the ForceThisNPCToStopBusy input which caused NPCs to keep acting busy when they shouldn't

This commit is contained in:
Blixibon 2021-04-23 22:57:11 -05:00
parent 45ca64863a
commit 425057453b
2 changed files with 13 additions and 2 deletions

View File

@ -2742,8 +2742,15 @@ void CAI_ActBusyGoal::InputForceThisNPCToStopBusy( inputdata_t &inputdata )
if ( !pBehavior ) if ( !pBehavior )
return; return;
// Just stop busying if (!IsActive() && pBehavior->GetActBusyGoal() == this)
pBehavior->StopBusying(); {
pBehavior->Disable();
}
else
{
// Just stop busying
pBehavior->StopBusying();
}
} }
#endif #endif

View File

@ -153,6 +153,10 @@ public:
bool IsInSafeZone( CBaseEntity *pEntity ); bool IsInSafeZone( CBaseEntity *pEntity );
int CountEnemiesInSafeZone(); int CountEnemiesInSafeZone();
#ifdef MAPBASE
CAI_ActBusyGoal *GetActBusyGoal() const { return m_hActBusyGoal; }
#endif
private: private:
virtual int SelectSchedule( void ); virtual int SelectSchedule( void );
int SelectScheduleForLeaving( void ); int SelectScheduleForLeaving( void );