Captives - Add listenable event handler for escorting (#9709)

Added escorting EH
This commit is contained in:
johnb432 2024-01-02 22:50:29 +01:00 committed by GitHub
parent 38684890eb
commit dababe84b9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 0 deletions

View File

@ -50,9 +50,14 @@ if (_state) then {
detach _target;
_unit removeAction _actionID;
_unit setVariable [QGVAR(escortedUnit), objNull, true];
// Public event
[QGVAR(escortingCaptive), [_target, false, _unit]] call CBA_fnc_localEvent;
};
}, 0, [_unit, _target, _actionID]] call CBA_fnc_addPerFrameHandler;
// Public event
[QGVAR(escortingCaptive), [_target, true, _unit]] call CBA_fnc_localEvent;
} else {
_unit setVariable [QGVAR(isEscorting), false, true];
_unit setVariable [QGVAR(escortedUnit), objNull, true];

View File

@ -67,6 +67,7 @@ MenuType: 0 = Interaction, 1 = Self Interaction
|`ace_captiveStatusChanged` | [_unit, _state(BOOL), _reason ("SetHandcuffed" or "SetSurrendered"), _caller] | Global | Listen | Unit's captivity state changed
|`ace_captives_setSurrendered` | [_unit, _state(BOOL)] | Target | Callable | Sets a unit to either start or stop surrendering
|`ace_captives_setHandcuffed` | [_unit, _state(BOOL)] | Target | Callable | Sets a unit to either start or stop being handcuffed
|`ace_captives_escortingCaptive` | [_unit, _state(BOOL), _caller] | Local | Listen | Caller starting or stopping escort of unit
### 2.6 Settings (`ace_common`)