diff --git a/@AresModAchillesExpansion/addons/functions_f_achilles/cfgFunctions.hpp b/@AresModAchillesExpansion/addons/functions_f_achilles/cfgFunctions.hpp index 4837adfd..5e3ea5fb 100644 --- a/@AresModAchillesExpansion/addons/functions_f_achilles/cfgFunctions.hpp +++ b/@AresModAchillesExpansion/addons/functions_f_achilles/cfgFunctions.hpp @@ -58,6 +58,7 @@ class CfgFunctions class vectDirUpFromDirPitchBank; class arrayStdDev; class transferOwnership; + class getAceMedicalFunction; }; class interpolation diff --git a/@AresModAchillesExpansion/addons/functions_f_achilles/functions/common/fn_getAceMedicalFunction.sqf b/@AresModAchillesExpansion/addons/functions_f_achilles/functions/common/fn_getAceMedicalFunction.sqf new file mode 100644 index 00000000..2ba2dc84 --- /dev/null +++ b/@AresModAchillesExpansion/addons/functions_f_achilles/functions/common/fn_getAceMedicalFunction.sqf @@ -0,0 +1,23 @@ +/* + * Author: DeliciousJaffa + * Determines what function we need to call (are we ACE v3.13+? (medical rewrite)). + * + * Arguments: + * None + * + * Return Value: + * Return Value + * + * Example: + * [] call Achilles_fnc_getAceMedicalFunction + * + * Public: No + */ + + private _function = switch (true) do { + case (!isNil "ace_medical_treatment_fnc_fullHeal"): {ace_medical_treatment_fnc_fullHeal}; + case (!isNil "ace_medical_fnc_treatmentAdvanced_fullHeal"): {ace_medical_fnc_treatmentAdvanced_fullHeal}; + default {{}}; +}; + +_function \ No newline at end of file diff --git a/@AresModAchillesExpansion/addons/functions_f_achilles/functions/features/fn_setACEInjury.sqf b/@AresModAchillesExpansion/addons/functions_f_achilles/functions/features/fn_setACEInjury.sqf index c11baeb4..ac000e2e 100644 --- a/@AresModAchillesExpansion/addons/functions_f_achilles/functions/features/fn_setACEInjury.sqf +++ b/@AresModAchillesExpansion/addons/functions_f_achilles/functions/features/fn_setACEInjury.sqf @@ -16,7 +16,10 @@ params ["_unit","_injury_type","_injury_value_list","_hits"]; -[_unit] call ace_medical_fnc_addVitalLoop; +// Add vital loop if ace medical is pre-rewrite +if (!isNil "ace_medical_fnc_treatmentAdvanced_fullHeal") then { + [_unit] call ace_medical_fnc_addVitalLoop; +}; { private _value = _injury_value_list select _forEachIndex; diff --git a/@AresModAchillesExpansion/addons/modules_f_achilles/ACE/functions/fn_ModuleACEHeal.sqf b/@AresModAchillesExpansion/addons/modules_f_achilles/ACE/functions/fn_ModuleACEHeal.sqf index 7a4c9093..d8a98516 100644 --- a/@AresModAchillesExpansion/addons/modules_f_achilles/ACE/functions/fn_ModuleACEHeal.sqf +++ b/@AresModAchillesExpansion/addons/modules_f_achilles/ACE/functions/fn_ModuleACEHeal.sqf @@ -34,13 +34,8 @@ if (isClass (configfile >> "CfgPatches" >> "ace_medical")) exitWith if (_selected_units isEqualTo []) exitWith {}; { - if (local _x) then - { - [_x, _x] call ace_medical_fnc_treatmentAdvanced_fullHealLocal - } else - { - [_x, _x] remoteExecCall ["ace_medical_fnc_treatmentAdvanced_fullHealLocal", _x] - }; + // Let ace handle propagating the heal (through CBA_fnc_targetEvent) + [player, _x] call (call Achilles_fnc_getAceMedicalFunction); } forEach _selected_units; }; diff --git a/@AresModAchillesExpansion/addons/modules_f_achilles/ACE/functions/fn_ModuleACEImmersiveHeal.sqf b/@AresModAchillesExpansion/addons/modules_f_achilles/ACE/functions/fn_ModuleACEImmersiveHeal.sqf index 9a3e63e6..6b5b9bee 100644 --- a/@AresModAchillesExpansion/addons/modules_f_achilles/ACE/functions/fn_ModuleACEImmersiveHeal.sqf +++ b/@AresModAchillesExpansion/addons/modules_f_achilles/ACE/functions/fn_ModuleACEImmersiveHeal.sqf @@ -54,13 +54,8 @@ private _fnc_reviveUnit = { // do the actual revive if (isClass (configfile >> "CfgPatches" >> "ace_medical")) then { - if (local _player) then - { - [_player, _player] call ace_medical_fnc_treatmentAdvanced_fullHealLocal - } else - { - [_player, _player] remoteExecCall ["ace_medical_fnc_treatmentAdvanced_fullHealLocal", _player] - }; + // Let ace handle propagating the heal (through CBA_fnc_targetEvent) + [_ai, _player] call (call Achilles_fnc_getAceMedicalFunction); }; if (!isNil "FAR_ReviveMode") then