Fix a few warnings (#11576)

This commit is contained in:
metalgearsloth
2022-10-04 14:24:19 +11:00
committed by GitHub
parent a6d20803a6
commit 600c0e3255
43 changed files with 185 additions and 167 deletions

View File

@@ -90,7 +90,7 @@ namespace Content.Shared.Chemistry.Components
return "";
}
var majorReagent = Contents.OrderByDescending(reagent => reagent.Quantity).First();
var majorReagent = Contents.MaxBy(reagent => reagent.Quantity);
return majorReagent.ReagentId;
}
@@ -134,9 +134,11 @@ namespace Content.Shared.Chemistry.Components
/// <param name="scale">The scalar to modify the solution by.</param>
public void ScaleSolution(float scale)
{
if (scale == 1) return;
if (scale.Equals(1f))
return;
var tempContents = new List<ReagentQuantity>(Contents);
foreach(ReagentQuantity current in tempContents)
foreach(var current in tempContents)
{
if(scale > 1)
{
@@ -231,7 +233,7 @@ namespace Content.Shared.Chemistry.Components
Contents[i] = new ReagentQuantity(reagent.ReagentId, newQuantity);
}
TotalVolume = TotalVolume * ratio;
TotalVolume *= ratio;
}
public void RemoveAllSolution()
@@ -381,14 +383,10 @@ namespace Content.Shared.Chemistry.Components
return newSolution;
}
[Obsolete("Use ReactiveSystem.DoEntityReaction")]
public void DoEntityReaction(EntityUid uid, ReactionMethod method)
{
var chemistry = EntitySystem.Get<ReactiveSystem>();
foreach (var (reagentId, quantity) in Contents.ToArray())
{
chemistry.ReactionEntity(uid, method, reagentId, quantity, this);
}
IoCManager.Resolve<IEntitySystemManager>().GetEntitySystem<ReactiveSystem>().DoEntityReaction(uid, this, method);
}
[Serializable, NetSerializable]