Solution rejig (#12428)

This commit is contained in:
Leon Friedrich
2023-01-12 16:41:40 +13:00
committed by GitHub
parent 38504f6412
commit 466384b081
61 changed files with 873 additions and 619 deletions

View File

@@ -164,7 +164,7 @@ namespace Content.Server.Nutrition.EntitySystems
component.Opened = true;
UpdateAppearance(component);
var solution = _solutionContainerSystem.Drain(uid, interactions, interactions.DrainAvailable);
var solution = _solutionContainerSystem.Drain(uid, interactions, interactions.Volume);
_spillableSystem.SpillAt(uid, solution, "PuddleSmear");
_audio.PlayPvs(_audio.GetSound(component.BurstSound), uid, AudioParams.Default.WithVolume(-4));
@@ -240,7 +240,7 @@ namespace Content.Server.Nutrition.EntitySystems
}
if (!_solutionContainerSystem.TryGetDrainableSolution(drink.Owner, out var drinkSolution) ||
drinkSolution.DrainAvailable <= 0)
drinkSolution.Volume <= 0)
{
_popupSystem.PopupEntity(Loc.GetString("drink-component-try-use-drink-is-empty",
("entity", EntityManager.GetComponent<MetaDataComponent>(drink.Owner).EntityName)), drink.Owner, user);
@@ -301,7 +301,7 @@ namespace Content.Server.Nutrition.EntitySystems
return;
args.Drink.CancelToken = null;
var transferAmount = FixedPoint2.Min(args.Drink.TransferAmount, args.DrinkSolution.DrainAvailable);
var transferAmount = FixedPoint2.Min(args.Drink.TransferAmount, args.DrinkSolution.Volume);
var drained = _solutionContainerSystem.Drain(args.Drink.Owner, args.DrinkSolution, transferAmount);
var forceDrink = uid != args.User;

View File

@@ -163,8 +163,8 @@ namespace Content.Server.Nutrition.EntitySystems
return;
var transferAmount = args.Food.TransferAmount != null
? FixedPoint2.Min((FixedPoint2) args.Food.TransferAmount, args.FoodSolution.CurrentVolume)
: args.FoodSolution.CurrentVolume;
? FixedPoint2.Min((FixedPoint2) args.Food.TransferAmount, args.FoodSolution.Volume)
: args.FoodSolution.Volume;
var split = _solutionContainerSystem.SplitSolution((args.Food).Owner, args.FoodSolution, transferAmount);

View File

@@ -59,7 +59,7 @@ namespace Content.Server.Nutrition.EntitySystems
var sliceUid = EntityManager.SpawnEntity(component.Slice, transform.Coordinates);
var lostSolution = _solutionContainerSystem.SplitSolution(uid, solution,
solution.CurrentVolume / FixedPoint2.New(component.Count));
solution.Volume / FixedPoint2.New(component.Count));
// Fill new slice
FillSlice(sliceUid, lostSolution);

View File

@@ -117,12 +117,12 @@ namespace Content.Server.Nutrition.EntitySystems
var inhaledSolution = _solutionContainerSystem.SplitSolution(uid, solution, smokable.InhaleAmount * _timer);
if (solution.TotalVolume == FixedPoint2.Zero)
if (solution.Volume == FixedPoint2.Zero)
{
RaiseLocalEvent(uid, new SmokableSolutionEmptyEvent(), true);
}
if (inhaledSolution.TotalVolume == FixedPoint2.Zero)
if (inhaledSolution.Volume == FixedPoint2.Zero)
continue;
// This is awful. I hate this so much.

View File

@@ -39,7 +39,7 @@ namespace Content.Server.Nutrition.EntitySystems
public void UpdateTags(TrashOnEmptyComponent component, Solution solution)
{
if (solution.DrainAvailable <= 0)
if (solution.Volume <= 0)
{
_tagSystem.AddTag(component.Owner, "Trash");
return;