Solution rejig (#12428)
This commit is contained in:
@@ -145,7 +145,7 @@ public sealed partial class ChemistrySystem
|
||||
{
|
||||
_solutions.TryGetSolution(uid, InjectorComponent.SolutionName, out var solution);
|
||||
|
||||
var currentVolume = solution?.CurrentVolume ?? FixedPoint2.Zero;
|
||||
var currentVolume = solution?.Volume ?? FixedPoint2.Zero;
|
||||
var maxVolume = solution?.MaxVolume ?? FixedPoint2.Zero;
|
||||
|
||||
args.State = new SharedInjectorComponent.InjectorComponentState(currentVolume, maxVolume, component.ToggleState);
|
||||
@@ -323,7 +323,7 @@ public sealed partial class ChemistrySystem
|
||||
removedSolution.DoEntityReaction(targetBloodstream.Owner, ReactionMethod.Injection);
|
||||
|
||||
_popup.PopupEntity(Loc.GetString("injector-component-inject-success-message",
|
||||
("amount", removedSolution.TotalVolume),
|
||||
("amount", removedSolution.Volume),
|
||||
("target", Identity.Entity(targetBloodstream.Owner, EntityManager))), component.Owner, user);
|
||||
|
||||
Dirty(component);
|
||||
@@ -333,7 +333,7 @@ public sealed partial class ChemistrySystem
|
||||
private void TryInject(InjectorComponent component, EntityUid targetEntity, Solution targetSolution, EntityUid user, bool asRefill)
|
||||
{
|
||||
if (!_solutions.TryGetSolution(component.Owner, InjectorComponent.SolutionName, out var solution)
|
||||
|| solution.CurrentVolume == 0)
|
||||
|| solution.Volume == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -363,7 +363,7 @@ public sealed partial class ChemistrySystem
|
||||
}
|
||||
|
||||
_popup.PopupEntity(Loc.GetString("injector-component-transfer-success-message",
|
||||
("amount", removedSolution.TotalVolume),
|
||||
("amount", removedSolution.Volume),
|
||||
("target", Identity.Entity(targetEntity, EntityManager))), component.Owner, user);
|
||||
|
||||
Dirty(component);
|
||||
@@ -374,7 +374,7 @@ public sealed partial class ChemistrySystem
|
||||
{
|
||||
// Automatically set syringe to draw after completely draining it.
|
||||
if (_solutions.TryGetSolution(component.Owner, InjectorComponent.SolutionName, out var solution)
|
||||
&& solution.CurrentVolume == 0)
|
||||
&& solution.Volume == 0)
|
||||
{
|
||||
component.ToggleState = SharedInjectorComponent.InjectorToggleMode.Draw;
|
||||
}
|
||||
@@ -399,7 +399,7 @@ public sealed partial class ChemistrySystem
|
||||
}
|
||||
|
||||
// Get transfer amount. May be smaller than _transferAmount if not enough room, also make sure there's room in the injector
|
||||
var realTransferAmount = FixedPoint2.Min(component.TransferAmount, targetSolution.DrawAvailable, solution.AvailableVolume);
|
||||
var realTransferAmount = FixedPoint2.Min(component.TransferAmount, targetSolution.Volume, solution.AvailableVolume);
|
||||
|
||||
if (realTransferAmount <= 0)
|
||||
{
|
||||
@@ -424,7 +424,7 @@ public sealed partial class ChemistrySystem
|
||||
}
|
||||
|
||||
_popup.PopupEntity(Loc.GetString("injector-component-draw-success-message",
|
||||
("amount", removedSolution.TotalVolume),
|
||||
("amount", removedSolution.Volume),
|
||||
("target", Identity.Entity(targetEntity, EntityManager))), component.Owner, user);
|
||||
|
||||
Dirty(component);
|
||||
@@ -436,7 +436,7 @@ public sealed partial class ChemistrySystem
|
||||
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
|
||||
if (stream.ChemicalSolution.Volume > 0f) // If they have stuff in their chem stream, we'll draw some of that
|
||||
{
|
||||
bloodAmount = drawAmount * 0.85f;
|
||||
chemAmount = drawAmount * 0.15f;
|
||||
|
||||
Reference in New Issue
Block a user