Captives - Add caller to captiveStatusChanged event (#8360)

* Add caller to ace_captiveStatusChanged event

* missing bracket

* Spaces, default value for _caller in setHandcuffed

Co-authored-by: Filip Maciejewski <veteran29@users.noreply.github.com>

* use default value in SetSurrendered

Co-authored-by: Filip Maciejewski <veteran29@users.noreply.github.com>

* update function example in doRemoveHandcuffs

* fix undefined variable

a lesson in not copy-pasting code

Co-authored-by: PabstMirror <pabstmirror@gmail.com>

* ditto last commit

Co-authored-by: PabstMirror <pabstmirror@gmail.com>

Co-authored-by: Filip Maciejewski <veteran29@users.noreply.github.com>
Co-authored-by: PabstMirror <pabstmirror@gmail.com>
This commit is contained in:
Salluci 2021-09-03 16:38:49 -03:00 committed by GitHub
parent f7126383fe
commit be8a50c8a9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 11 additions and 9 deletions

View File

@ -21,6 +21,6 @@ params ["_unit", "_target"];
playSound3D [QUOTE(PATHTO_R(sounds\cable_tie_zipping.ogg)), objNull, false, (getPosASL _target), 1, 1, 10];
[QGVAR(setHandcuffed), [_target, true], [_target]] call CBA_fnc_targetEvent;
[QGVAR(setHandcuffed), [_target, true, _unit], [_target]] call CBA_fnc_targetEvent;
_unit removeItem "ACE_CableTie";

View File

@ -4,17 +4,18 @@
* Remove handcuffs from a target
*
* Arguments:
* 0: target <OBJECT>
* 0: Caller <OBJECT>
* 1: Target <OBJECT>
*
* Return Value:
* The return value <BOOL>
*
* Example:
* [bob, false] call ACE_captives_fnc_doRemoveHandcuffs
* [bob, bill] call ACE_captives_fnc_doRemoveHandcuffs
*
* Public: No
*/
params ["_unit", "_target"];
[QGVAR(setHandcuffed), [_target, false], [_target]] call CBA_fnc_targetEvent;
[QGVAR(setHandcuffed), [_target, false, _unit], [_target]] call CBA_fnc_targetEvent;

View File

@ -6,18 +6,19 @@
* Arguments:
* 0: Unit <OBJECT>
* 1: True to take captive, false to release captive <BOOL>
* 2: Caller <OBJECT>
*
* Return Value:
* None
*
* Example:
* [bob, true] call ACE_captives_fnc_setHandcuffed;
* [bob, true, dave] call ACE_captives_fnc_setHandcuffed;
*
* Public: No
*/
params ["_unit","_state"];
TRACE_2("params",_unit,_state);
params ["_unit", "_state", ["_caller", objNull]];
TRACE_3("params",_unit,_state,_caller);
if (!local _unit) exitWith {
WARNING("running setHandcuffed on remote unit");
@ -103,4 +104,4 @@ if (_state) then {
};
//Global Event after changes:
["ace_captiveStatusChanged", [_unit, _state, "SetHandcuffed"]] call CBA_fnc_globalEvent;
["ace_captiveStatusChanged", [_unit, _state, "SetHandcuffed", _caller]] call CBA_fnc_globalEvent;

View File

@ -62,7 +62,7 @@ MenuType: 0 = Interaction, 1 = Self Interaction
| Event Key | Parameters | Locality | Type | Description |
|----------|---------|---------|---------|---------|---------|
|`ace_captiveStatusChanged` | [_unit, _state(BOOL), _reason ("SetHandcuffed" or "SetSurrendered")] | Global | Listen | Unit's captivity state changed
|`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