From cd7765e7d954868dc7998196bd93995b74c6e6ff Mon Sep 17 00:00:00 2001 From: Fooberticus Bazly <34943053+fooberticus@users.noreply.github.com> Date: Sun, 17 Jul 2022 02:32:19 -0400 Subject: [PATCH] using existing FixedPoint2 for popup message, instead of raw float (#9820) Co-authored-by: fooberticus --- .../EntitySystems/ChemistrySystem.Injector.cs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/Content.Server/Chemistry/EntitySystems/ChemistrySystem.Injector.cs b/Content.Server/Chemistry/EntitySystems/ChemistrySystem.Injector.cs index ad5499ea2c..761553bba7 100644 --- a/Content.Server/Chemistry/EntitySystems/ChemistrySystem.Injector.cs +++ b/Content.Server/Chemistry/EntitySystems/ChemistrySystem.Injector.cs @@ -355,10 +355,10 @@ public sealed partial class ChemistrySystem return; } - /// We have some snowflaked behavior for streams. + // We have some snowflaked behavior for streams. if (stream != null) { - DrawFromBlood(user, targetEntity, component, solution, stream, (float) realTransferAmount); + DrawFromBlood(user, targetEntity, component, solution, stream, realTransferAmount); return; } @@ -378,10 +378,11 @@ public sealed partial class ChemistrySystem AfterDraw(component); } - private void DrawFromBlood(EntityUid user, EntityUid target, InjectorComponent component, Solution injectorSolution, BloodstreamComponent stream, float drawAmount) + private void DrawFromBlood(EntityUid user, EntityUid target, InjectorComponent component, Solution injectorSolution, BloodstreamComponent stream, FixedPoint2 transferAmount) { - float bloodAmount = drawAmount; - float chemAmount = 0f; + var drawAmount = (float) transferAmount; + var bloodAmount = drawAmount; + var chemAmount = 0f; if (stream.ChemicalSolution.CurrentVolume > 0f) // If they have stuff in their chem stream, we'll draw some of that { bloodAmount = drawAmount * 0.85f; @@ -395,7 +396,7 @@ public sealed partial class ChemistrySystem _solutions.TryAddSolution(component.Owner, injectorSolution, chemTemp); _popup.PopupEntity(Loc.GetString("injector-component-draw-success-message", - ("amount", drawAmount), + ("amount", transferAmount), ("target", Identity.Entity(target, EntityManager))), component.Owner, Filter.Entities(user)); Dirty(component);