forge/arma/server/addons/task/functions/fnc_makeObject.sqf
Jacob Schmidt 9deb73ec8e Migrate task logic to object classes
- Move task implementations from prototype scripts into `functions/objects`
- Keep public task functions as compatibility adapters
- Update docs and init wiring for the new object-based layout
2026-05-15 18:50:28 -05:00

22 lines
713 B
Plaintext

#include "..\script_component.hpp"
/*
* Assigns an object to a task as a protected target.
*
* Public compatibility adapter around ProtectedEntityController.
*/
params [["_entity", objNull, [objNull]], ["_taskID", "", [""]]];
if (isNull _entity) exitWith { ["ERROR", "Attempt to create entity from null object"] call EFUNC(common,log); false };
if (_taskID isEqualTo "") exitWith { ["ERROR", "No task ID provided for entity"] call EFUNC(common,log); false };
["INFO", format ["Make Object: %1", _this]] call EFUNC(common,log);
private _controller = createHashMapObject [
GVAR(ProtectedEntityController),
[_taskID, _entity, createHashMap]
];
_controller call ["registerTaskEntity", ["entities"]]