ACE3/addons/zeus/functions/fnc_addObjectToCurator.sqf
SilentSpike ca01f31b52 Improve zeus auto-add XEH behaviour
The XEH InitPost event only needs to be added if the `GVAR(autoAddObjects)` setting is enabled. This change will save on overhead when the setting is disabled and also removes some complexity from the function that runs in response to the event.
2016-06-18 15:41:13 +01:00

26 lines
471 B
Plaintext

/*
* Author: Glowbal
* Adds an object to curator upon spawn
*
* Arguments:
* Object <OBJECT>
*
* Return Value:
* None
*
* Public: No
*/
#include "script_component.hpp"
params ["_object"];
if (!(_object getVariable [QGVAR(addObject), GVAR(autoAddObjects)])) exitWith {};
[{
TRACE_1("Delayed addCuratorEditableObjects",_this);
{
_x addCuratorEditableObjects [[_this], true];
} forEach allCurators;
}, _object] call CBA_fnc_execNextFrame;