Some more int -> decimal conversions. Changed the use of the Solution constructor.
This commit is contained in:
@@ -172,7 +172,7 @@ namespace Content.Shared.Chemistry
|
||||
public Solution SplitSolution(decimal quantity)
|
||||
{
|
||||
if (quantity <= 0)
|
||||
return new Solution();
|
||||
return IoCManager.InjectDependencies(new Solution());
|
||||
|
||||
Solution newSolution;
|
||||
|
||||
@@ -183,7 +183,7 @@ namespace Content.Shared.Chemistry
|
||||
return newSolution;
|
||||
}
|
||||
|
||||
newSolution = new Solution();
|
||||
newSolution = IoCManager.InjectDependencies(new Solution());
|
||||
var newTotalVolume = 0M;
|
||||
var ratio = (TotalVolume - quantity) / TotalVolume;
|
||||
|
||||
@@ -235,7 +235,7 @@ namespace Content.Shared.Chemistry
|
||||
public Solution Clone()
|
||||
{
|
||||
var volume = 0M;
|
||||
var newSolution = new Solution();
|
||||
var newSolution = IoCManager.InjectDependencies(new Solution());
|
||||
|
||||
for (var i = 0; i < _contents.Count; i++)
|
||||
{
|
||||
|
||||
@@ -17,7 +17,7 @@ namespace Content.Shared.GameObjects.Components.Chemistry
|
||||
#pragma warning restore 649
|
||||
|
||||
[ViewVariables]
|
||||
protected Solution ContainedSolution = new Solution();
|
||||
protected Solution ContainedSolution;
|
||||
private decimal _maxVolume;
|
||||
private SolutionCaps _capabilities;
|
||||
|
||||
@@ -95,15 +95,20 @@ namespace Content.Shared.GameObjects.Components.Chemistry
|
||||
base.ExposeData(serializer);
|
||||
|
||||
serializer.DataField(ref _maxVolume, "maxVol", 0M);
|
||||
serializer.DataField(ref ContainedSolution, "contents", ContainedSolution);
|
||||
serializer.DataField(ref ContainedSolution, "contents", IoCManager.InjectDependencies(new Solution()));
|
||||
serializer.DataField(ref _capabilities, "caps", SolutionCaps.None);
|
||||
}
|
||||
|
||||
public virtual void Init()
|
||||
{
|
||||
ContainedSolution = IoCManager.InjectDependencies(new Solution());
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Startup()
|
||||
{
|
||||
base.Startup();
|
||||
|
||||
|
||||
RecalculateColor();
|
||||
}
|
||||
|
||||
@@ -113,7 +118,7 @@ namespace Content.Shared.GameObjects.Components.Chemistry
|
||||
base.Shutdown();
|
||||
|
||||
ContainedSolution.RemoveAllSolution();
|
||||
ContainedSolution = new Solution();
|
||||
ContainedSolution = IoCManager.InjectDependencies(new Solution());
|
||||
}
|
||||
|
||||
public void RemoveAllSolution()
|
||||
|
||||
Reference in New Issue
Block a user