sp/src/game/server/lab/npc_shadow_walker.cpp
int CNPC_ShadowWalker::SelectFailSchedule(int failedSchedule, int failedTask, AI_TaskFailureCode_t taskFailCode)
{
	switch (failedSchedule)
	{
	case SCHED_NEW_WEAPON:
		// If failed trying to pick up a weapon, try again in one second. This is because other AI code
		// has put this off for 10 seconds under the assumption that the citizen would be able to 
		// pick up the weapon that they found. 
		m_flNextWeaponSearchTime = gpGlobals->curtime + 1.0f;
		break;
	case SCHED_TAKE_COVER_FROM_ENEMY:
		// I can't take cover, so I need to run away!
		return SCHED_RUN_FROM_ENEMY;
	case SCHED_CHASE_ENEMY:
		// I can't run towards the enemy, so I will just run randomly!
		return SCHED_CHASE_ENEMY_FAILED;
	case SCHED_RUN_FROM_ENEMY:
		// I can't run away, so I will just run randomly!
		return SCHED_RUN_RANDOM;
	case SCHED_INVESTIGATE_SOUND:
		// I can't investigate a sound I heard.
		return SCHED_IDLE_WANDER;
	}

	return BaseClass::SelectFailSchedule(failedSchedule, failedTask, taskFailCode);
}
//-----------------------------------------------------------------------------
// Purpose: Choose a schedule after schedule failed
//-----------------------------------------------------------------------------
Choose a schedule after schedule failed
Choose a schedule after schedule failed
int CNPC_ShadowWalker::SelectFailSchedule(int failedSchedule, int failedTask, AI_TaskFailureCode_t taskFailCode)
{
	switch (failedSchedule)
	{
	case SCHED_NEW_WEAPON:
		m_flNextWeaponSearchTime = gpGlobals->curtime + 1.0f;
		break;
	case SCHED_TAKE_COVER_FROM_ENEMY:
		return SCHED_RUN_FROM_ENEMY;
	case SCHED_CHASE_ENEMY:
		return SCHED_CHASE_ENEMY_FAILED;
	case SCHED_RUN_FROM_ENEMY:
		return SCHED_RUN_RANDOM;
	case SCHED_INVESTIGATE_SOUND:
		return SCHED_IDLE_WANDER;
	}
	return BaseClass::SelectFailSchedule(failedSchedule, failedTask, taskFailCode);
}
int CNPC_ShadowWalker :: SelectFailSchedule ( int failedSchedule , int failedTask , AI_TaskFailureCode_t taskFailCode ) { switch ( failedSchedule ) { case SCHED_NEW_WEAPON : m_flNextWeaponSearchTime = gpGlobals -> curtime + 1.0f ; break ; case SCHED_TAKE_COVER_FROM_ENEMY : return SCHED_RUN_FROM_ENEMY ; case SCHED_CHASE_ENEMY : return SCHED_CHASE_ENEMY_FAILED ; case SCHED_RUN_FROM_ENEMY : return SCHED_RUN_RANDOM ; case SCHED_INVESTIGATE_SOUND : return SCHED_IDLE_WANDER ; } return BaseClass :: SelectFailSchedule ( failedSchedule , failedTask , taskFailCode ) ; }
Purpose: Choose a schedule after schedule failed
Purpose : Choose a schedule after schedule failed
// If failed trying to pick up a weapon, try again in one second. This is because other AI code // has put this off for 10 seconds under the assumption that the citizen would be able to  // pick up the weapon that they found.  // I can't take cover, so I need to run away! // I can't run towards the enemy, so I will just run randomly! // I can't run away, so I will just run randomly! // I can't investigate a sound I heard.