mirror of
https://github.com/YGGverse/hlsdk-portable.git
synced 2025-01-24 05:34:18 +00:00
Properly exit medic healing when schedule is changed forcibly
This commit is contained in:
parent
5ba209e66f
commit
3c6ad215d1
@ -172,6 +172,7 @@ public:
|
||||
void ClearSchedule( void );
|
||||
BOOL FScheduleDone( void );
|
||||
void ChangeSchedule( Schedule_t *pNewSchedule );
|
||||
virtual void OnChangeSchedule( Schedule_t *pNewSchedule ) {}
|
||||
void NextScheduledTask( void );
|
||||
Schedule_t *ScheduleInList( const char *pName, Schedule_t **pList, int listCount );
|
||||
|
||||
|
@ -250,6 +250,7 @@ public:
|
||||
void StartTask( Task_t *pTask );
|
||||
Schedule_t *GetSchedule ( void );
|
||||
Schedule_t *GetScheduleOfType(int Type);
|
||||
void OnChangeSchedule( Schedule_t *pNewSchedule );
|
||||
void StopFollowing( BOOL clearSchedule );
|
||||
void SetAnswerQuestion(CTalkMonster *pSpeaker);
|
||||
|
||||
@ -3623,12 +3624,16 @@ void CMedic::RunTask(Task_t *pTask)
|
||||
}
|
||||
}
|
||||
|
||||
Schedule_t *CMedic::GetSchedule()
|
||||
void CMedic::OnChangeSchedule( Schedule_t *pNewSchedule )
|
||||
{
|
||||
if (m_fHealing) {
|
||||
StopHealing();
|
||||
}
|
||||
CHFGrunt::OnChangeSchedule( pNewSchedule );
|
||||
}
|
||||
|
||||
Schedule_t *CMedic::GetSchedule()
|
||||
{
|
||||
Schedule_t* prioritizedSchedule = PrioritizedSchedule();
|
||||
if (prioritizedSchedule)
|
||||
return prioritizedSchedule;
|
||||
@ -3866,7 +3871,6 @@ void CMedic::StartFollowingHealTarget(CBaseEntity *pTarget)
|
||||
m_hTargetEnt = pTarget;
|
||||
ClearConditions( bits_COND_CLIENT_PUSH );
|
||||
ClearSchedule();
|
||||
ChangeSchedule(GetScheduleOfType(SCHED_MEDIC_HEAL));
|
||||
ALERT(at_aiconsole, "Medic started to follow injured %s\n", STRING(pTarget->pev->classname));
|
||||
}
|
||||
|
||||
|
@ -79,6 +79,8 @@ void CBaseMonster::ChangeSchedule( Schedule_t *pNewSchedule )
|
||||
{
|
||||
ASSERT( pNewSchedule != NULL );
|
||||
|
||||
OnChangeSchedule( pNewSchedule );
|
||||
|
||||
m_pSchedule = pNewSchedule;
|
||||
m_iScheduleIndex = 0;
|
||||
m_iTaskStatus = TASKSTATUS_NEW;
|
||||
|
Loading…
x
Reference in New Issue
Block a user