#include "..\script_component.hpp"

/*
 * Author: IDSolutions
 * Assigns an object to a task as a protected target
 *
 * Arguments:
 * 0: The object <OBJECT>
 * 1: ID of the task <STRING>
 *
 * Return Value:
 * None
 *
 * Example:
 * [this, "task_name"] spawn forge_client_task_fnc_makeObject;
 *
 * Public: Yes
 */

params [["_entity", objNull, [objNull]], ["_taskID", "", [""]]];

if (isNull _entity) exitWith { diag_log "ERROR: Attempt to create entity from null object"; };
if (_taskID == "") exitWith { diag_log "ERROR: No task ID provided for entity"; };

diag_log format ["[FORGE] Make Object: %1", _this];

SETPVAR(_entity,assignedTask,_taskID);
GVAR(allEntities) pushBackUnique _entity;