using existing FixedPoint2 for popup message, instead of raw float (#9820)
Co-authored-by: fooberticus <fooberticus@protonmail.com>
This commit is contained in:
committed by
GitHub
parent
94141ad021
commit
cd7765e7d9
@@ -355,10 +355,10 @@ public sealed partial class ChemistrySystem
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// We have some snowflaked behavior for streams.
|
// We have some snowflaked behavior for streams.
|
||||||
if (stream != null)
|
if (stream != null)
|
||||||
{
|
{
|
||||||
DrawFromBlood(user, targetEntity, component, solution, stream, (float) realTransferAmount);
|
DrawFromBlood(user, targetEntity, component, solution, stream, realTransferAmount);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -378,10 +378,11 @@ public sealed partial class ChemistrySystem
|
|||||||
AfterDraw(component);
|
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;
|
var drawAmount = (float) transferAmount;
|
||||||
float chemAmount = 0f;
|
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
|
if (stream.ChemicalSolution.CurrentVolume > 0f) // If they have stuff in their chem stream, we'll draw some of that
|
||||||
{
|
{
|
||||||
bloodAmount = drawAmount * 0.85f;
|
bloodAmount = drawAmount * 0.85f;
|
||||||
@@ -395,7 +396,7 @@ public sealed partial class ChemistrySystem
|
|||||||
_solutions.TryAddSolution(component.Owner, injectorSolution, chemTemp);
|
_solutions.TryAddSolution(component.Owner, injectorSolution, chemTemp);
|
||||||
|
|
||||||
_popup.PopupEntity(Loc.GetString("injector-component-draw-success-message",
|
_popup.PopupEntity(Loc.GetString("injector-component-draw-success-message",
|
||||||
("amount", drawAmount),
|
("amount", transferAmount),
|
||||||
("target", Identity.Entity(target, EntityManager))), component.Owner, Filter.Entities(user));
|
("target", Identity.Entity(target, EntityManager))), component.Owner, Filter.Entities(user));
|
||||||
|
|
||||||
Dirty(component);
|
Dirty(component);
|
||||||
|
|||||||
Reference in New Issue
Block a user