From fa6d587dfdd2ba72a2239642bff0ee4294e4f828 Mon Sep 17 00:00:00 2001 From: cadon Date: Fri, 26 Nov 2021 10:41:24 +0100 Subject: [PATCH] removed rough estimation of food spoiling for clarity --- ARKBreedingStats/raising/RaisingControl.cs | 5 +++-- ARKBreedingStats/uiControls/Trough.cs | 5 +---- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/ARKBreedingStats/raising/RaisingControl.cs b/ARKBreedingStats/raising/RaisingControl.cs index eea9f804..d2295a5d 100644 --- a/ARKBreedingStats/raising/RaisingControl.cs +++ b/ARKBreedingStats/raising/RaisingControl.cs @@ -79,7 +79,8 @@ public void UpdateRaisingData(Species species, bool forceUpdate = false) _ignoreChangedFood = false; var selectIndex = string.IsNullOrEmpty(_lastSelectedFood) ? 0 : eats.IndexOf(_lastSelectedFood); if (selectIndex == -1) selectIndex = 0; - CbGrowingFood.SelectedIndex = selectIndex; + if (CbGrowingFood.Items.Count > 0) + CbGrowingFood.SelectedIndex = selectIndex; if (Raising.GetRaisingTimes(_selectedSpecies, out TimeSpan matingTime, out string incubationMode, out TimeSpan incubationTime, out _babyTime, out _maturationTime, out TimeSpan nextMatingMin, @@ -177,7 +178,7 @@ string FoodAmountString(string _foodName) + $"\nTotal Food for maturation: ~{Math.Ceiling(totalFood / foodValue)} {_foodName}"; } - foodAmount += "\n - Loss by spoiling is only a rough estimate and may vary."; + foodAmount += "\n - Loss by spoiling is not considered!"; } LbFoodInfoGeneral.Text = foodAmount; diff --git a/ARKBreedingStats/uiControls/Trough.cs b/ARKBreedingStats/uiControls/Trough.cs index 5bf89206..394b4423 100644 --- a/ARKBreedingStats/uiControls/Trough.cs +++ b/ARKBreedingStats/uiControls/Trough.cs @@ -29,7 +29,6 @@ public class Trough /// /// Calculates the needed food from a specific maturation to a specific maturation. - /// The returned value adds 10 % to compensate for spoiling. /// public static bool FoodAmountFromUntil(Species species, double babyFoodConsumptionSpeedMultiplier, double currentMaturation, double untilMaturation, out double totalFood) { @@ -52,9 +51,7 @@ public static bool FoodAmountFromUntil(Species species, double babyFoodConsumpti // calculate area of rectangle and triangle on top to get the total food needed // assuming foodRateStart > foodRateEnd totalFood = species.breeding.maturationTimeAdjusted * ((untilMaturation - currentMaturation) * (foodRateEnd + 0.5 * (foodRateStart - foodRateEnd))); - - totalFood *= 1.1; // rough estimation of spoiling - + return true; } }