Skip to content
This repository has been archived by the owner on May 24, 2022. It is now read-only.

Field Rations - Fix for changes to ace_medical #230

Merged
merged 1 commit into from
Apr 20, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions addons/field_rations/functions/fnc_handleEffects.sqf
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#include "script_component.hpp"
/*
* Author: mharis001, Glowbal, PabstMirror
* Handles the effects/consequences of high thirst/hunger.
Expand All @@ -15,14 +16,13 @@
*
* Public: No
*/
#include "script_component.hpp"

params ["_player", "_thirst", "_hunger"];

// Kill unit with max thirst or hunger
if ((_thirst > 99.9 || {_hunger > 99.9}) && {random 1 < 0.5}) exitWith {
if (["ace_medical"] call ACEFUNC(common,isModLoaded)) then {
_player call ACEFUNC(medical,setDead);
[_player, "Hunger/Thirst empty"] call ACEFUNC(medical_status,setDead);
} else {
_player setDamage 1;
};
Expand All @@ -34,7 +34,7 @@ if !(_player call ACEFUNC(common,isAwake)) exitWith {};
// Set unit unconscious (chance based on how high thirst/hunger are)
if ((_thirst > 85 || {_hunger > 85}) && {random 1 < linearConversion [85, 100, _thirst max _hunger, 0.05, 0.1, true]}) exitWith {
if (["ace_medical"] call ACEFUNC(common,isModLoaded)) then {
[_player, true, 5] call ACEFUNC(medical,setUnconscious);
[_player, true, 5, true] call ACEFUNC(medical,setUnconscious);
};
};

Expand Down