forge/arma/server/addons/task/functions/fnc_makeCargo.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

23 lines
746 B
Plaintext

#include "..\script_component.hpp"
/*
* Assigns cargo to a task for delivery.
*
* Public compatibility adapter around CargoEntityController.
*/
params [["_cargo", objNull, [objNull]], ["_taskID", "", [""]]];
["INFO", format ["Make Cargo: %1", _this]] call EFUNC(common,log);
if (isNull _cargo) exitWith { ["ERROR", "Attempt to create cargo from null object"] call EFUNC(common,log); false };
if (_taskID isEqualTo "") exitWith { ["ERROR", "No task ID provided for cargo"] call EFUNC(common,log); false };
private _controller = createHashMapObject [
GVAR(CargoEntityController),
[_taskID, _cargo, createHashMap]
];
if !(_controller call ["registerTaskEntity", ["cargo"]]) exitWith { false };
_controller call ["watchDamage", []]