From 17c1ef3c03aabeb3c829c15124ab5d71102d3c3c Mon Sep 17 00:00:00 2001 From: mrschick <58027418+mrschick@users.noreply.github.com> Date: Sun, 11 Aug 2024 19:27:57 +0200 Subject: [PATCH] Condense condition for consequence --- addons/field_rations/functions/fnc_handleEffects.sqf | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/addons/field_rations/functions/fnc_handleEffects.sqf b/addons/field_rations/functions/fnc_handleEffects.sqf index 980454cac7..d84608ac22 100644 --- a/addons/field_rations/functions/fnc_handleEffects.sqf +++ b/addons/field_rations/functions/fnc_handleEffects.sqf @@ -30,13 +30,11 @@ if !(_player call EFUNC(common,isAwake)) exitWith {}; // Trigger high thirst/hunger consequence if ( GETEGVAR(medical,enabled,false) && - {(_thirst > 85 || {_hunger > 85})} + {(_thirst > 85 || {_hunger > 85})} && + {random 1 < linearConversion [85, 100, _thirst max _hunger, 0.05, 0.1, true]} ) exitWith { if (XGVAR(nearDepletedConsequence) == 1) then { // Set unit unconscious with a 45s cooldown - if ( - (CBA_missionTime - XGVAR(lastUnconEvent)) > 45 && - {random 1 < linearConversion [85, 100, _thirst max _hunger, 0.05, 0.1, true]} - ) then { + if (CBA_missionTime - XGVAR(lastUnconEvent) > 45) then { [_player, true, 5, true] call EFUNC(medical,setUnconscious); XGVAR(lastUnconEvent) = CBA_missionTime; };