From ed0d9cd4218ba99878bec28ffb674fd37cdcfbd0 Mon Sep 17 00:00:00 2001 From: musurca Date: Sat, 11 Jan 2020 12:49:20 -0800 Subject: [PATCH] ACE3 medical update fix --- README.md | 3 +++ addons/GR/functions/fn_onLocalCivKilled.sqf | 4 ++++ addons/GR/functions/fn_onUnitKilled.sqf | 4 ++++ mod.cpp | 2 +- 4 files changed, 12 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index c055d7d..1dc0169 100644 --- a/README.md +++ b/README.md @@ -93,6 +93,9 @@ For questions, comments, or bug reports, please contact me directly at nick.musu CHANGELOG: --------------------- +v1.31 (January 11, 2020): +* bugfix: two events created on civilian death (related to ACE3 Medical update) + v1.3 (May 25, 2019): * added: Autopsies * added: autopsy event handler if concealed death is revealed diff --git a/addons/GR/functions/fn_onLocalCivKilled.sqf b/addons/GR/functions/fn_onLocalCivKilled.sqf index 6b70c71..3b245d1 100644 --- a/addons/GR/functions/fn_onLocalCivKilled.sqf +++ b/addons/GR/functions/fn_onLocalCivKilled.sqf @@ -9,6 +9,10 @@ params ["_killed", ["_killer", objNull]]; +//Workaround for ACE3 Medical bug in which "killed" EH is called twice +if (_killed getVariable ["GR_WASKILLED",0] == 1) exitWith {}; +_killed setVariable ["GR_WASKILLED",1]; + if(side (group _killed) == civilian) then { // Workaround for ACE medical if ((isNull _killer) || {_killer == _killed}) then { diff --git a/addons/GR/functions/fn_onUnitKilled.sqf b/addons/GR/functions/fn_onUnitKilled.sqf index 3d1406a..30570ef 100644 --- a/addons/GR/functions/fn_onUnitKilled.sqf +++ b/addons/GR/functions/fn_onUnitKilled.sqf @@ -11,6 +11,10 @@ if (!isServer) exitWith {}; params ["_killed", ["_killer", objNull]]; +//Workaround for ACE3 Medical bug in which "killed" EH is called twice +if (_killed getVariable ["GR_WASKILLED",0] == 1) exitWith {}; +_killed setVariable ["GR_WASKILLED",1]; + if ((isNull _killer) || {_killer == _killed}) then { _killer = _killed getVariable ["ace_medical_lastDamageSource", objNull]; }; diff --git a/mod.cpp b/mod.cpp index c77b5a9..cff9fa0 100644 --- a/mod.cpp +++ b/mod.cpp @@ -12,4 +12,4 @@ overview = "Civilian deaths, reparations, and war crimes. Deliver the bodies of author = "@musurca"; overviewText = "GR"; overviewPicture = "img\logomain.paa"; -overviewFootnote = "v130"; \ No newline at end of file +overviewFootnote = "v131"; \ No newline at end of file