class ClearQuickhackQueueEffector extends Effector
{

	protected override function ActionOn( owner : GameObject )
	{
		var player : weak< GameObject >;
		player = GameInstance.GetPlayerSystem( owner.GetGame() ).GetLocalPlayerMainGameObject();
		ClearQuickhackQueue( ( ( ScriptedPuppet )( owner ) ), player );
	}

	public function ClearQuickhackQueue( scriptedPuppet : ScriptedPuppet, player : weak< GameObject > )
	{
		var action : ScriptableDeviceAction;
		var currentAction : ScriptableDeviceAction;
		var deviceActionQueue : DeviceActionQueue;
		if( !( scriptedPuppet ) )
		{
			return;
		}
		currentAction = scriptedPuppet.GetCurrentlyUploadingAction();
		if( !( currentAction ) )
		{
			return;
		}
		deviceActionQueue = currentAction.m_deviceActionQueue;
		if( !( deviceActionQueue ) )
		{
			return;
		}
		while( deviceActionQueue.HasActionInQueue() )
		{
			action = ( ( ScriptableDeviceAction )( deviceActionQueue.PopActionInQueue() ) );
			if( action && ( action.GetExecutor() == player ) )
			{
				RPGManager.DecrementQuickHackBlackboard( scriptedPuppet.GetGame(), action.GetObjectActionID() );
				QuickHackableQueueHelper.DecreaseQuickHackQueueCount( ( ( PlayerPuppet )( action.GetExecutor() ) ) );
			}
		}
		scriptedPuppet.QueueEvent( new DeactivateQuickHackIndicatorEvent );
		QuickhackModule.RequestRefreshQuickhackMenu( player.GetGame(), currentAction.GetRequesterID() );
	}

}

