2023-09-12 18:58:10 +00:00
|
|
|
#include "..\script_component.hpp"
|
2015-05-28 15:56:45 +00:00
|
|
|
/*
|
|
|
|
* Author: Garth 'L-H' de Wet
|
|
|
|
* When a take/put event handler fires and a detonator is changed hands.
|
|
|
|
* Then take "attached" explosives.
|
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
* 0: Receiver <OBJECT>
|
|
|
|
* 1: Giver <OBJECT>
|
|
|
|
* 2: Item <STRING>
|
|
|
|
*
|
|
|
|
* Return Value:
|
|
|
|
* None
|
|
|
|
*
|
|
|
|
* Example:
|
|
|
|
* Handled by CBA
|
|
|
|
*
|
|
|
|
* Public: No
|
|
|
|
*/
|
2015-08-15 19:35:33 +00:00
|
|
|
|
|
|
|
params ["_receiver", "_giver", "_item"];
|
|
|
|
TRACE_3("params",_receiver,_giver,_item);
|
|
|
|
|
2016-12-14 20:06:32 +00:00
|
|
|
if ((_receiver != ace_player) && {_giver != ace_player}) exitWith {};
|
2015-05-28 15:56:45 +00:00
|
|
|
|
2016-12-14 20:06:32 +00:00
|
|
|
private _config = ConfigFile >> "CfgWeapons" >> _item;
|
2016-01-14 22:05:56 +00:00
|
|
|
if (isClass _config && {getNumber(_config >> QGVAR(Detonator)) == 1}) then {
|
2017-10-10 14:39:59 +00:00
|
|
|
private _clackerItems = _giver getVariable [QGVAR(Clackers), []];
|
2015-11-30 16:53:57 +00:00
|
|
|
_receiver setVariable [QGVAR(Clackers), (_receiver getVariable [QGVAR(Clackers), []]) + _clackerItems, true];
|
2015-05-28 15:56:45 +00:00
|
|
|
|
2016-12-14 20:06:32 +00:00
|
|
|
private _detonators = [_giver] call FUNC(getDetonators);
|
2015-05-28 15:56:45 +00:00
|
|
|
if (count _detonators == 0) then {
|
|
|
|
_giver setVariable [QGVAR(Clackers), nil, true];
|
|
|
|
};
|
|
|
|
};
|