Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ace medical update #517

Merged
merged 10 commits into from
Jan 19, 2020
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ class CfgFunctions
class vectDirUpFromDirPitchBank;
class arrayStdDev;
class transferOwnership;
class getAceMedicalFunction;
};

class interpolation
Expand Down
Original file line number Diff line number Diff line change
@@ -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 <CODE>
*
* 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
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down