From 7a6c6df33b7645042af685881fb34c996549c22d Mon Sep 17 00:00:00 2001 From: icomrade Date: Wed, 8 Mar 2017 13:57:00 -0500 Subject: [PATCH] re-add config for nutrition --- SQF/dayz_code/configVariables.sqf | 1 + SQF/dayz_code/init/compiles.sqf | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/SQF/dayz_code/configVariables.sqf b/SQF/dayz_code/configVariables.sqf index 980d39785..2e41d9d97 100644 --- a/SQF/dayz_code/configVariables.sqf +++ b/SQF/dayz_code/configVariables.sqf @@ -33,6 +33,7 @@ DZE_NoBuildNearDistance = 150; // Distance from blacklisted objects to disallow DZE_GodModeBaseExclude = []; //Array of object class names excluded from the god mode bases feature DZE_salvageLocked = true; //Enable or disable salvaging of locked vehicles, useful for stopping griefing on locked vehicles. DZE_DisabledChannels = [(localize "str_channel_side"),(localize "str_channel_global"),(localize "str_channel_command")]; //List of disabled voice channels. Other channels are: "str_channel_group","str_channel_direct","str_channel_vehicle" +DZE_NutritionDivisor = [1, 1, 1, 1]; //array of DIVISORS that regulate the rate of [calories, thirst, hunger, temperature] use when "working" (keep in mind that temperature raises with actions) - min values 0.1 - Larger values slow the effect, smaller values accelerate it // Death Messages DZE_DeathMsgChat = "none"; //"none","global","side","system" Display death messages in selected chat channel. diff --git a/SQF/dayz_code/init/compiles.sqf b/SQF/dayz_code/init/compiles.sqf index ee7c0715e..f989d454d 100644 --- a/SQF/dayz_code/init/compiles.sqf +++ b/SQF/dayz_code/init/compiles.sqf @@ -334,10 +334,10 @@ if (!isDedicated) then { }; case "Working": { - if (_calorieCount > 0) then { dayz_nutrition = dayz_nutrition - _calorieCount; }; - if (_thirstCount > 0) then { dayz_thirst = dayz_thirst + _thirstCount; }; - if (_hungerCount > 0) then { dayz_hunger = dayz_hunger + _hungerCount; }; - if (_tempCount > 0) then { dayz_temperatur = dayz_temperatur + _tempCount; }; + if (_calorieCount > 0) then { dayz_nutrition = dayz_nutrition - (_calorieCount / ((DZE_NutritionDivisor select 0) max 0.1)); }; + if (_thirstCount > 0) then { dayz_thirst = dayz_thirst + (_thirstCount / ((DZE_NutritionDivisor select 1) max 0.1)); }; + if (_hungerCount > 0) then { dayz_hunger = dayz_hunger + (_hungerCount / ((DZE_NutritionDivisor select 2) max 0.1)); }; + if (_tempCount > 0) then { dayz_temperatur = dayz_temperatur + (_tempCount / ((DZE_NutritionDivisor select 3) max 0.1)); }; }; };