diff --git a/addons/medical/XEH_postInit.sqf b/addons/medical/XEH_postInit.sqf index b8152f08b8..15aa362409 100644 --- a/addons/medical/XEH_postInit.sqf +++ b/addons/medical/XEH_postInit.sqf @@ -131,7 +131,7 @@ GVAR(effectTimeBlood) = time; }; }; - _bleeding = ACE_player call FUNC(getBloodLoss); + _bleeding = [ACE_player] call FUNC(getBloodLoss); // Bleeding Indicator if (_bleeding > 0 and GVAR(effectTimeBlood) + 3.5 < time) then { GVAR(effectTimeBlood) = time; @@ -250,7 +250,7 @@ if (USE_WOUND_EVENT_SYNC) then { [ {(((_this select 0) getvariable [QGVAR(bloodVolume), 100]) < 65)}, {(((_this select 0) getvariable [QGVAR(pain), 0]) > 0.9)}, - {(((_this select 0) call FUNC(getBloodLoss)) > 0.25)}, + {(([_this select 0] call FUNC(getBloodLoss)) > 0.25)}, {((_this select 0) getvariable [QGVAR(inReviveState), false])}, {((_this select 0) getvariable [QGVAR(inCardiacArrest), false])}, {((_this select 0) getvariable ["ACE_isDead", false])}, diff --git a/addons/medical/functions/fnc_getBloodLoss.sqf b/addons/medical/functions/fnc_getBloodLoss.sqf index f6b26f7686..aa94d7dc33 100644 --- a/addons/medical/functions/fnc_getBloodLoss.sqf +++ b/addons/medical/functions/fnc_getBloodLoss.sqf @@ -15,15 +15,17 @@ #define BLOODLOSSRATE_BASIC 0.2 -private ["_totalBloodLoss","_tourniquets","_openWounds", "_value", "_cardiacOutput", "_internalWounds"]; -// TODO Only use this calculation if medium or higher, otherwise use vanilla calculations (for basic medical). +private ["_unit", "_totalBloodLoss","_tourniquets","_openWounds", "_value", "_cardiacOutput", "_internalWounds"]; + +_unit = _this select 0; + _totalBloodLoss = 0; // Advanced medical bloodloss handling if (GVAR(level) >= 2) then { - _tourniquets = _this getvariable [QGVAR(tourniquets), [0,0,0,0,0,0]]; - _openWounds = _this getvariable [QGVAR(openWounds), []]; - //_cardiacOutput = [_this] call FUNC(getCardiacOutput); + _tourniquets = _unit getvariable [QGVAR(tourniquets), [0,0,0,0,0,0]]; + _openWounds = _unit getvariable [QGVAR(openWounds), []]; + //_cardiacOutput = [_unit] call FUNC(getCardiacOutput); { if ((_tourniquets select (_x select 2)) == 0) then { @@ -34,7 +36,7 @@ if (GVAR(level) >= 2) then { }; }foreach _openWounds; - _internalWounds = _this getvariable [QGVAR(internalWounds), []]; + _internalWounds = _unit getvariable [QGVAR(internalWounds), []]; { _totalBloodLoss = _totalBloodLoss + ((_x select 4) * (_x select 3)); }foreach _internalWounds; @@ -42,6 +44,6 @@ if (GVAR(level) >= 2) then { // cap the blood loss to be no greater as the current cardiac output //(_totalBloodLoss min _cardiacOutput); } else { - _totalBloodLoss = BLOODLOSSRATE_BASIC * (damage _this); + _totalBloodLoss = BLOODLOSSRATE_BASIC * (damage _unit); }; _totalBloodLoss * (GVAR(bleedingCoefficient) max 0); diff --git a/addons/medical/functions/fnc_getBloodVolumeChange.sqf b/addons/medical/functions/fnc_getBloodVolumeChange.sqf index f94c5d5b7b..23eba4a0c7 100644 --- a/addons/medical/functions/fnc_getBloodVolumeChange.sqf +++ b/addons/medical/functions/fnc_getBloodVolumeChange.sqf @@ -34,7 +34,7 @@ private ["_unit","_bloodVolume","_bloodVolumeChange", "_ivVolume"]; _unit = _this select 0; _bloodVolume = _unit getvariable [QGVAR(bloodVolume), 100]; -_bloodVolumeChange = -(_unit call FUNC(getBloodLoss)); +_bloodVolumeChange = -([_unit] call FUNC(getBloodLoss)); if (_bloodVolume < 100.0) then { { diff --git a/addons/medical/functions/fnc_getHeartRateChange.sqf b/addons/medical/functions/fnc_getHeartRateChange.sqf index e7bc9407d2..f3fec64053 100644 --- a/addons/medical/functions/fnc_getHeartRateChange.sqf +++ b/addons/medical/functions/fnc_getHeartRateChange.sqf @@ -20,7 +20,7 @@ _unit = _this select 0; _hrIncrease = 0; if (!(_unit getvariable [QGVAR(inCardiacArrest),false])) then { _heartRate = _unit getvariable [QGVAR(heartRate), 80]; - _bloodLoss = _unit call FUNC(getBloodLoss); + _bloodLoss = [_unit] call FUNC(getBloodLoss); _adjustment = _unit getvariable [QGVAR(heartRateAdjustments), []]; { @@ -83,4 +83,4 @@ if (!(_unit getvariable [QGVAR(inCardiacArrest),false])) then { _hrIncrease = _hrIncrease - HEART_RATE_MODIFIER; }; }; -_hrIncrease \ No newline at end of file +_hrIncrease diff --git a/addons/medical/functions/fnc_handleUnitVitals.sqf b/addons/medical/functions/fnc_handleUnitVitals.sqf index 411f64b49e..f986a095de 100644 --- a/addons/medical/functions/fnc_handleUnitVitals.sqf +++ b/addons/medical/functions/fnc_handleUnitVitals.sqf @@ -43,7 +43,7 @@ if (_bloodVolume < 90) then { }; }; -if ((_unit call FUNC(getBloodLoss)) > 0) then { +if (([_unit] call FUNC(getBloodLoss)) > 0) then { if !(_unit getvariable [QGVAR(isBleeding), false]) then { _unit setvariable [QGVAR(isBleeding), true, true]; };