2023-09-12 18:58:10 +00:00
|
|
|
#include "..\script_component.hpp"
|
2015-09-18 19:46:21 +00:00
|
|
|
/*
|
|
|
|
* Author: Glowbal
|
|
|
|
* N/A
|
2015-01-16 23:21:47 +00:00
|
|
|
*
|
2015-09-18 19:46:21 +00:00
|
|
|
* Arguments:
|
2017-06-08 13:31:51 +00:00
|
|
|
* 0: Unit <OBJECT>
|
|
|
|
* 1: ID? <STRING>
|
|
|
|
* 2: Accepted <BOOL>
|
2015-09-18 19:46:21 +00:00
|
|
|
*
|
|
|
|
* Return Value:
|
2017-06-08 13:31:51 +00:00
|
|
|
* None
|
|
|
|
*
|
|
|
|
* Example:
|
|
|
|
* [bob, "ID", true] call ace_common_fnc_onAnswerRequest
|
2015-09-18 19:46:21 +00:00
|
|
|
*
|
|
|
|
* Public: No
|
2015-01-16 23:21:47 +00:00
|
|
|
*/
|
|
|
|
|
2015-09-18 19:46:21 +00:00
|
|
|
params ["_unit", "_id", "_accepted"];
|
2015-05-14 18:06:06 +00:00
|
|
|
|
2015-12-12 15:48:54 +00:00
|
|
|
private _info = _unit getVariable _id;
|
2015-09-18 19:46:21 +00:00
|
|
|
|
2015-11-30 16:22:16 +00:00
|
|
|
if (!isNil "_info") then {
|
2015-12-12 15:48:54 +00:00
|
|
|
_info params ["_caller", "_target", "_requestID", "_requestMessage", "_callBack"];
|
|
|
|
|
|
|
|
private _replyParams = [_info, _accepted];
|
2016-06-03 00:59:18 +00:00
|
|
|
[QGVAR(requestCallback), _replyParams, _caller] call CBA_fnc_targetEvent;
|
2015-11-30 16:27:09 +00:00
|
|
|
_unit setVariable [_id, nil];
|
2015-01-16 23:21:47 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
GVAR(RECIEVE_REQUEST_ID_KEY_BINDING) = nil;
|
|
|
|
|
2015-11-30 16:22:16 +00:00
|
|
|
if (!isNil QGVAR(RECIEVE_REQUEST_ADD_ACTION_ACCEPT)) then {
|
2015-01-18 19:09:19 +00:00
|
|
|
_unit removeAction GVAR(RECIEVE_REQUEST_ADD_ACTION_ACCEPT);
|
|
|
|
GVAR(RECIEVE_REQUEST_ADD_ACTION_ACCEPT) = nil;
|
2015-01-16 23:21:47 +00:00
|
|
|
};
|
2015-11-30 16:22:16 +00:00
|
|
|
if (!isNil QGVAR(RECIEVE_REQUEST_ADD_ACTION_DECLINE)) then {
|
2015-01-18 19:09:19 +00:00
|
|
|
_unit removeAction GVAR(RECIEVE_REQUEST_ADD_ACTION_DECLINE);
|
|
|
|
GVAR(RECIEVE_REQUEST_ADD_ACTION_DECLINE) = nil;
|
2015-01-16 23:21:47 +00:00
|
|
|
};
|