mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Advanced Throwing - Call ammo event handlers (#9535)
AdvThrowing - Run ammo event handlers Close #9532
This commit is contained in:
parent
f0a6fc7b9d
commit
124798cb8d
@ -1,6 +1,7 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
// Fired XEH
|
||||
GVAR(ammoEventHandlers) = createHashMap;
|
||||
[QGVAR(throwFiredXEH), FUNC(throwFiredXEH)] call CBA_fnc_addEventHandler;
|
||||
|
||||
// Exit on HC
|
||||
|
@ -20,14 +20,25 @@
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
|
||||
params ["_unit", "", "_muzzle", "", "_ammo"];
|
||||
TRACE_1("Fired",_this);
|
||||
|
||||
{
|
||||
_this call _x;
|
||||
} forEach ((_this select 0) getVariable "cba_xeh_fired");
|
||||
} forEach (_unit getVariable "cba_xeh_fired");
|
||||
|
||||
// Call muzzle fired EH
|
||||
{
|
||||
_this call compile getText (_x >> "fired");
|
||||
} forEach (configProperties [configFile >> "CfgWeapons" >> "Throw" >> (_this select 2) >> "EventHandlers", "isClass _x", true]);
|
||||
} forEach (configProperties [configFile >> "CfgWeapons" >> "Throw" >> _muzzle >> "EventHandlers", "isClass _x", true]);
|
||||
|
||||
// Call ammo fired EH
|
||||
{ _this call _x } forEach (GVAR(ammoEventHandlers) getOrDefaultCall [_ammo, {
|
||||
private _cfg = configFile >> "CfgAmmo" >> _ammo >> "EventHandlers";
|
||||
private _eventHandlers = [];
|
||||
{
|
||||
private _eh = getText (_x >> "fired");
|
||||
if (_eh != "") then { _eventHandlers pushBack compile _eh };
|
||||
} forEach ([_cfg] + configProperties [_cfg, "isClass _x", true]);
|
||||
_eventHandlers
|
||||
}, true]);
|
||||
|
Loading…
Reference in New Issue
Block a user