mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
b54992b8fc
Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com> Co-authored-by: LinkIsGrim <salluci.lovi@gmail.com>
34 lines
751 B
Plaintext
34 lines
751 B
Plaintext
#include "..\script_component.hpp"
|
|
/*
|
|
* Author: Dystopian
|
|
* Detaches child.
|
|
* Run globally.
|
|
*
|
|
* Arguments:
|
|
* 0: Child <OBJECT>
|
|
*
|
|
* Return Value:
|
|
* None
|
|
*
|
|
* Example:
|
|
* cursorObject call ace_towing_fnc_detachChild
|
|
*
|
|
* Public: No
|
|
*/
|
|
params ["_child"];
|
|
TRACE_1("detachChild",_child);
|
|
|
|
_child setTowParent objNull;
|
|
|
|
if (!isServer) exitWith {};
|
|
|
|
_child setVariable [QGVAR(parent), objNull, true];
|
|
GVAR(allChildren) = GVAR(allChildren) - [_child];
|
|
|
|
private _childChildHooks = _child getVariable [QGVAR(childHooks), []];
|
|
if (_childChildHooks isEqualTo []) then {
|
|
TRACE_1("remove Deleted EH",_child);
|
|
_child removeEventHandler ["Deleted", _child getVariable [QGVAR(DeletedEHID), -1]];
|
|
_child setVariable [QGVAR(DeletedEHID), -1];
|
|
};
|