-
Notifications
You must be signed in to change notification settings - Fork 737
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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>
- Loading branch information
1 parent
b1451d7
commit 3b62af6
Showing
6 changed files
with
38 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
PREP(disableCookoff); | ||
PREP(handlePunjiTrapDamage); | ||
PREP(handlePunjiTrapTrigger); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
[QGVAR(handlePunjiTrapDamage), LINKFUNC(handlePunjiTrapDamage)] call CBA_fnc_addEventHandler; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
optionals/compat_sog/functions/fnc_handlePunjiTrapTrigger.sqf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#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; |