ACE3/optionals/compat_sog/functions/fnc_handlePunjiTrapTrigger.sqf
GhostIsSpooky 3b62af6131
SOG Compat - Fix remote punji traps not causing damage (#8755)
* Initial commit

* derp

* fix derp

* fix derp again

* don't code without coffee

* damage locality is weird, bi pls fix

* Update fnc_handlePunjiTrapTrigger.sqf

Co-authored-by: PabstMirror <pabstmirror@gmail.com>
2022-03-07 12:25:55 -06:00

26 lines
688 B
Plaintext

#include "script_component.hpp"
/*
* Author: GhostIsSpooky
* Handler for 'detonation' of a local punji trap. Workaround for local-only ammo hit event.
*
* Arguments:
* 0: Punji trap <OBJECT>
*
* Return Value:
* None
*
* Example:
* [trap] call ace_compat_sog_fnc_handlePunjiTrapTrigger
*
* Public: No
*/
params ["_trap"];
if (!(["ACE_Medical"] call EFUNC(common,isModLoaded))) exitWith {};
private _radius = getNumber (configOf _trap >> "indirectHitRange");
private _affectedUnits = (_trap nearEntities ["CAManBase", _radius]);
if (_affectedUnits isEqualTo []) exitWith {};
[QGVAR(handlePunjiTrapDamage), [_trap, _affectedUnits], _affectedUnits] call CBA_fnc_targetEvent;