class WaitIfEnteringOrLeavingCover extends AIbehaviortaskScript
{

	protected override function Activate( context : ScriptExecutionContext )
	{
		SetUpdateInterval( context, RandomizeOffsetForUpdateInterval( 0.1 ) );
	}

	protected override function Update( context : ScriptExecutionContext ) : AIbehaviorUpdateOutcome
	{
		var cm : CoverManager;
		cm = GameInstance.GetCoverManager( ScriptExecutionContext.GetOwner( context ).GetGame() );
		if( !( cm ) )
		{
			return AIbehaviorUpdateOutcome.FAILURE;
		}
		if( cm.IsEnteringOrLeavingCover( ScriptExecutionContext.GetOwner( context ) ) )
		{
			return AIbehaviorUpdateOutcome.IN_PROGRESS;
		}
		return AIbehaviorUpdateOutcome.SUCCESS;
	}

}

