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:
|
|
|
|
* ?
|
|
|
|
*
|
|
|
|
* Return Value:
|
|
|
|
* ?
|
|
|
|
*
|
|
|
|
* Public: No
|
2015-01-16 23:21:47 +00:00
|
|
|
*/
|
|
|
|
#include "script_component.hpp"
|
|
|
|
|
2015-09-18 19:46:21 +00:00
|
|
|
params ["_unit", "_id", "_accepted"];
|
2015-05-14 18:06:06 +00:00
|
|
|
|
2015-09-18 19:46:21 +00:00
|
|
|
private ["_requestID", "_info", "_callBack", "_caller", "_replyParams", "_requestMessage", "_target"];
|
2015-01-16 23:21:47 +00:00
|
|
|
|
2015-11-30 16:27:09 +00:00
|
|
|
_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-01-18 19:09:19 +00:00
|
|
|
_caller = _info select 0;
|
|
|
|
_target = _info select 1;
|
|
|
|
_requestID = _info select 2;
|
|
|
|
_requestMessage = _info select 3;
|
|
|
|
_callBack = _info select 4;
|
|
|
|
_replyParams = [_info, _accepted];
|
2015-09-18 19:46:21 +00:00
|
|
|
[_replyParams, QFUNC(requestCallback), _caller, false] call FUNC(execRemoteFnc);
|
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
|
|
|
};
|