Changed all int and some float things in Reagent code to Decimals

This commit is contained in:
PrPleGoo
2020-03-14 12:55:07 +01:00
parent b9f9eb6651
commit f05fdfb5fc
19 changed files with 101 additions and 81 deletions

View File

@@ -5,6 +5,7 @@ using Content.Server.GameObjects.EntitySystems;
using Content.Shared.Chemistry;
using Content.Shared.GameObjects.Components.Nutrition;
using Content.Shared.Interfaces;
using Content.Shared.Maths;
using Robust.Server.GameObjects;
using Robust.Shared.GameObjects;
using Robust.Shared.Interfaces.GameObjects;
@@ -32,11 +33,11 @@ namespace Content.Server.GameObjects.Components.Nutrition
[ViewVariables]
private string _finishPrototype;
public int TransferAmount => _transferAmount;
public decimal TransferAmount => _transferAmount;
[ViewVariables]
private int _transferAmount = 2;
private decimal _transferAmount = 2;
public int MaxVolume
public decimal MaxVolume
{
get => _contents.MaxVolume;
set => _contents.MaxVolume = value;
@@ -56,7 +57,7 @@ namespace Content.Server.GameObjects.Components.Nutrition
{
return 0;
}
return Math.Max(1, _contents.CurrentVolume / _transferAmount);
return Math.Max(1, (int)Math.Ceiling(_contents.CurrentVolume / _transferAmount));
}