From bf9140f1b5244206fa459fc3571c2b625c8cbd12 Mon Sep 17 00:00:00 2001 From: ebaydayz Date: Tue, 26 Apr 2016 18:46:07 -0400 Subject: [PATCH] Fix dayz_nutrition RPT error on login Looks like the error was: r_player_Nutrition = [_NutritionLoss]; It should have used the set command, since the array was already defined in variables.sqf. But there is no need to use an array for a single value anyway. Fixes RPT error on login: Error in expression 0) then { _Nutrition = > Error position: 0) then { _Nutrition = > Error Undefined variable in expression: dayz_nutrition File z\addons\dayz_code\system\player_spawn_2.sqf, line 182 --- SQF/dayz_code/init/variables.sqf | 2 +- SQF/dayz_code/medical/setup_functions_med.sqf | 2 +- SQF/dayz_code/system/player_spawn_2.sqf | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/SQF/dayz_code/init/variables.sqf b/SQF/dayz_code/init/variables.sqf index 757094902..a3e4739af 100644 --- a/SQF/dayz_code/init/variables.sqf +++ b/SQF/dayz_code/init/variables.sqf @@ -314,7 +314,7 @@ carryClick = false; dayz_workingInprogress = false; //INT Nutrition Info -r_player_Nutrition = [0]; //[Calories] +r_player_Nutrition = 0; // Calories r_player_nutritionMuilpty = 2; //count actions diff --git a/SQF/dayz_code/medical/setup_functions_med.sqf b/SQF/dayz_code/medical/setup_functions_med.sqf index b9b5e9390..3131b5858 100644 --- a/SQF/dayz_code/medical/setup_functions_med.sqf +++ b/SQF/dayz_code/medical/setup_functions_med.sqf @@ -177,7 +177,7 @@ fnc_usec_calculateBloodPerSec = { _bloodLossPerSec = _bloodLossPerSec + 3; }; - //_golbalNutrition = 1200 / (r_player_Nutrition select 0); + //_golbalNutrition = 1200 / r_player_Nutrition; if (r_player_bloodregen > 0) then { _bloodGainPerSec = r_player_bloodregen * 0.1; diff --git a/SQF/dayz_code/system/player_spawn_2.sqf b/SQF/dayz_code/system/player_spawn_2.sqf index 5e06606d6..29561b821 100644 --- a/SQF/dayz_code/system/player_spawn_2.sqf +++ b/SQF/dayz_code/system/player_spawn_2.sqf @@ -186,11 +186,11 @@ while {1 == 1} do { _hunger = (abs((((r_player_bloodTotal - r_player_blood) / r_player_bloodTotal) * 5) + _speed + dayz_myLoad) * 3); _thirst = 2; if (_refObj == player) then {_thirst = (_speed + 4) * 3;}; _NutritionLoss = _Nutrition - (((_thirst / 1000) + (_hunger / 1000)) * (dayz_temperatur / dayz_temperaturnormal)); - r_player_Nutrition = [_NutritionLoss]; + r_player_Nutrition = _NutritionLoss; } else { - r_player_Nutrition = [0]; + r_player_Nutrition = 0; }; - dayz_nutrition = r_player_Nutrition select 0; + dayz_nutrition = r_player_Nutrition; //Temperatur 2 call player_temp_calculation; //2 = sleep time of this loop //TeeChange