forge/arma/server/addons/task/XEH_postInit.sqf
Jacob Schmidt 07d5422091 Refactor task management system with object prototypes and enhanced logging
- Updated fnc_extCall.sqf to suppress logging for specific functions.
- Added object model prototypes for task instances in prototypes/taskObjectPrototypes.sqf.
- Enhanced README.md to document the new object model and its purpose.
- Modified XEH_postInit.sqf to improve event handling for defuse tasks.
- Updated various task functions (fnc_attack, fnc_defend, fnc_defuse, fnc_delivery, fnc_destroy, fnc_heartBeat, fnc_hostage, fnc_hvt) to include task acceptance checks.
- Improved fnc_makeHostage and fnc_makeIED to ensure proper task registration and state management.
- Introduced new methods in task object prototypes for better state management and task flow control.
2026-04-28 23:04:22 -05:00

29 lines
940 B
Plaintext

#include "script_component.hpp"
["ace_explosives_defuse", {
private _taskID = "";
private _explosive = objNull;
{
if (_x isEqualType objNull && { !isNull _x }) then {
if (isNull _explosive) then { _explosive = _x; };
_taskID = _x getVariable ["assignedTask", ""];
if (_taskID isNotEqualTo "") exitWith {};
};
} forEach _this;
if (_taskID isEqualTo "" && { !isNull _explosive }) then {
_taskID = GVAR(TaskStore) call ["findTaskEntityOwner", ["ieds", _explosive]];
};
if (_taskID isEqualTo "") exitWith {
["WARNING", format [
"ACE Defuse Event Ignored: No assignedTask found. Explosive=%1, Type=%2, NetID=%3",
_explosive,
typeOf _explosive,
netId _explosive
]] call EFUNC(common,log);
};
GVAR(TaskStore) call ["incrementDefuseCount", [_taskID]];
}] call CFUNC(addEventHandler);