Skip to content

Commit

Permalink
formating / use GET_OPEN_WOUNDS
Browse files Browse the repository at this point in the history
  • Loading branch information
PabstMirror committed Jun 23, 2019
1 parent 1b428d8 commit 2e5ffe3
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 14 deletions.
6 changes: 3 additions & 3 deletions addons/medical_ai/functions/fnc_canRequestMedic.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ if ([_this] call EFUNC(medical_treatment,isMedic) || {vehicle _this != _this}) e
private _medic = objNull;
{
if ([_x] call EFUNC(medical_treatment,isMedic) && {!([_x] call EFUNC(common,isPlayer))} && {
_medic = _x;
(unitReady _medic)
}) exitWith {};
_medic = _x;
(unitReady _medic)
}) exitWith {};
} forEach (units _this);

_this setVariable [QGVAR(assignedMedic), _medic];
Expand Down
21 changes: 10 additions & 11 deletions addons/medical_ai/functions/fnc_healingLogic.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ private _treatmentEvent = "#none";
private _treatmentArgs = [];
private _treatmentTime = 6;
switch (true) do {
case (GET_WOUND_BLEEDING(_target) > 0): {
case (GET_WOUND_BLEEDING(_target) > 0): {
// Select first bleeding wound and bandage it
private _openWounds = _target getVariable [QEGVAR(medical,openWounds), []];
private _openWounds = GET_OPEN_WOUNDS(_target);
private _selection = "?";
{
_x params ["", "_index", "_amount", "_percentage"];
Expand All @@ -54,7 +54,7 @@ case (GET_WOUND_BLEEDING(_target) > 0): {
_treatmentTime = 5;
_treatmentArgs = [_target, _selection, "FieldDressing"];
};
case (_isMedic && {GET_BLOOD_VOLUME(_target) < BLOOD_VOLUME_CLASS_2_HEMORRHAGE}): {
case (_isMedic && {GET_BLOOD_VOLUME(_target) < BLOOD_VOLUME_CLASS_2_HEMORRHAGE}): {
private _bloodBags = _target getVariable [QEGVAR(medical,ivBags), []];
if ((count _bloodBags) >= 2) exitWith {
_treatmentEvent = "#waitForBlood";
Expand All @@ -63,20 +63,20 @@ case (_isMedic && {GET_BLOOD_VOLUME(_target) < BLOOD_VOLUME_CLASS_2_HEMORRHAGE})
_treatmentTime = 5;
_treatmentArgs = [_target, selectRandom ["leftarm", "rightarm", "leftleg", "rightleg"], "SalineIV"];
};
case ((count (_target getVariable [VAR_MEDICATIONS, []])) >= 6): {
case ((count (_target getVariable [VAR_MEDICATIONS, []])) >= 6): {
_treatmentEvent = "#tooManyMeds";
};
case ((_fractures select 4) == 1): {
case ((_fractures select 4) == 1): {
_treatmentEvent = QEGVAR(medical_treatment,splintLocal);
_treatmentTime = 6;
_treatmentArgs = [_healer, _target, "leftleg"];
};
case ((_fractures select 5) == 1): {
};
case ((_fractures select 5) == 1): {
_treatmentEvent = QEGVAR(medical_treatment,splintLocal);
_treatmentTime = 6;
_treatmentArgs = [_healer, _target, "rightleg"];
};
case (IS_UNCONSCIOUS(_target) || {_heartRate <= 50}): {
};
case (IS_UNCONSCIOUS(_target) || {_heartRate <= 50}): {
if (CBA_missionTime < (_target getVariable [QGVAR(nextEpinephrine), -1])) exitWith {
_treatmentEvent = "#waitForEpinephrineToTakeEffect";
};
Expand All @@ -88,7 +88,7 @@ case (IS_UNCONSCIOUS(_target) || {_heartRate <= 50}): {
_treatmentTime = 2.5;
_treatmentArgs = [_target, selectRandom ["leftarm", "rightarm", "leftleg", "rightleg"], "Epinephrine"];
};
case ((GET_PAIN_PERCEIVED(_target) > 0.25) || {_heartRate >= 180}): {
case ((GET_PAIN_PERCEIVED(_target) > 0.25) || {_heartRate >= 180}): {
if (CBA_missionTime < (_target getVariable [QGVAR(nextMorphine), -1])) exitWith {
_treatmentEvent = "#waitForMorphineToTakeEffect";
};
Expand All @@ -111,7 +111,6 @@ if ((_treatmentEvent select [0,1]) != "#") then {
[_healer, _treatmentClassname, (_healer == _target)] call FUNC(playTreatmentAnim);
};


#ifdef DEBUG_MODE_FULL
TRACE_4("treatment started",_treatmentTime,_target,_treatmentEvent,_treatmentArgs);
systemChat format ["Treatment [%1->%2]: %3", _healer, _target, _treatmentEvent];
Expand Down

0 comments on commit 2e5ffe3

Please sign in to comment.