Fixing some warnings (#6250)

Co-authored-by: Paul Ritter <ritter.paul1@googlemail.com>
This commit is contained in:
wrexbe
2022-01-21 01:38:35 -08:00
committed by GitHub
parent 29b22e2871
commit cea1b21832
191 changed files with 341 additions and 340 deletions

View File

@@ -156,7 +156,7 @@ namespace Content.Shared.Chemistry.Reaction
/// Perform a reaction on a solution. This assumes all reaction criteria are met.
/// Removes the reactants from the solution, then returns a solution with all products.
/// </summary>
private Solution PerformReaction(Solution solution, EntityUid Owner, ReactionPrototype reaction, FixedPoint2 unitReactions)
private Solution PerformReaction(Solution solution, EntityUid owner, ReactionPrototype reaction, FixedPoint2 unitReactions)
{
// We do this so that ReagentEffect can have something to work with, even if it's
// a little meaningless.
@@ -179,14 +179,14 @@ namespace Content.Shared.Chemistry.Reaction
}
// Trigger reaction effects
OnReaction(solution, reaction, randomReagent, Owner, unitReactions);
OnReaction(solution, reaction, randomReagent, owner, unitReactions);
return products;
}
protected virtual void OnReaction(Solution solution, ReactionPrototype reaction, ReagentPrototype randomReagent, EntityUid Owner, FixedPoint2 unitReactions)
protected virtual void OnReaction(Solution solution, ReactionPrototype reaction, ReagentPrototype randomReagent, EntityUid owner, FixedPoint2 unitReactions)
{
var args = new ReagentEffectArgs(Owner, null, solution,
var args = new ReagentEffectArgs(owner, null, solution,
randomReagent,
unitReactions, EntityManager, null);
@@ -235,11 +235,11 @@ namespace Content.Shared.Chemistry.Reaction
/// <summary>
/// Continually react a solution until no more reactions occur.
/// </summary>
public void FullyReactSolution(Solution solution, EntityUid Owner)
public void FullyReactSolution(Solution solution, EntityUid owner)
{
for (var i = 0; i < MaxReactionIterations; i++)
{
if (!ProcessReactions(solution, Owner, out var products))
if (!ProcessReactions(solution, owner, out var products))
return;
if (products.TotalVolume <= 0)
@@ -247,18 +247,18 @@ namespace Content.Shared.Chemistry.Reaction
solution.AddSolution(products);
}
Logger.Error($"{nameof(Solution)} {Owner} could not finish reacting in under {MaxReactionIterations} loops.");
Logger.Error($"{nameof(Solution)} {owner} could not finish reacting in under {MaxReactionIterations} loops.");
}
/// <summary>
/// Continually react a solution until no more reactions occur, with a volume constraint.
/// If a reaction's products would exceed the max volume, some product is deleted.
/// </summary>
public void FullyReactSolution(Solution solution, EntityUid Owner, FixedPoint2 maxVolume)
public void FullyReactSolution(Solution solution, EntityUid owner, FixedPoint2 maxVolume)
{
for (var i = 0; i < MaxReactionIterations; i++)
{
if (!ProcessReactions(solution, Owner, out var products))
if (!ProcessReactions(solution, owner, out var products))
return;
if (products.TotalVolume <= 0)
@@ -274,7 +274,7 @@ namespace Content.Shared.Chemistry.Reaction
solution.AddSolution(products);
}
Logger.Error($"{nameof(Solution)} {Owner} could not finish reacting in under {MaxReactionIterations} loops.");
Logger.Error($"{nameof(Solution)} {owner} could not finish reacting in under {MaxReactionIterations} loops.");
}
}
}

View File

@@ -73,15 +73,15 @@ namespace Content.Shared.Climbing
}
}
protected bool _isClimbing;
private bool _isClimbing;
// TODO: Layers need a re-work
private void ToggleSmallPassable(bool value)
{
// Hope the mob has one fixture
if (!_entMan.TryGetComponent<PhysicsComponent>(Owner, out var physicsComponent) || physicsComponent.Deleted) return;
if (!_entMan.TryGetComponent<FixturesComponent>(Owner, out var fixturesComponent) || fixturesComponent.Deleted) return;
foreach (var fixture in physicsComponent.Fixtures)
foreach (var fixture in fixturesComponent.Fixtures.Values)
{
if (value)
{

View File

@@ -10,6 +10,7 @@ using Robust.Shared.IoC;
using Robust.Shared.Log;
using Robust.Shared.Physics;
using Robust.Shared.Physics.Dynamics;
using System.Linq;
namespace Content.Shared.Throwing
{
@@ -54,17 +55,19 @@ namespace Content.Shared.Throwing
private void ThrowItem(EntityUid uid, ThrownItemComponent component, ThrownEvent args)
{
if (!EntityManager.TryGetComponent(component.Owner, out PhysicsComponent? physicsComponent) ||
physicsComponent.Fixtures.Count != 1) return;
if (!EntityManager.TryGetComponent(component.Owner, out FixturesComponent? fixturesComponent) ||
fixturesComponent.Fixtures.Count != 1) return;
if (!EntityManager.TryGetComponent(component.Owner, out PhysicsComponent? physicsComponent)) return;
if (_fixtures.GetFixtureOrNull(physicsComponent, ThrowingFixture) != null)
if (fixturesComponent.Fixtures.ContainsKey(ThrowingFixture))
{
Logger.Error($"Found existing throwing fixture on {component.Owner}");
return;
}
var shape = physicsComponent.Fixtures[0].Shape;
_fixtures.CreateFixture(physicsComponent, new Fixture(physicsComponent, shape) {CollisionLayer = (int) CollisionGroup.ThrownItem, Hard = false, ID = ThrowingFixture});
var fixture = fixturesComponent.Fixtures.Values.First();
var shape = fixture.Shape;
var throwingFixture = new Fixture(physicsComponent, shape) { CollisionLayer = (int) CollisionGroup.ThrownItem, Hard = false, ID = ThrowingFixture };
_fixtures.CreateFixture(physicsComponent, throwingFixture, manager: fixturesComponent);
}
private void HandleCollision(EntityUid uid, ThrownItemComponent component, StartCollideEvent args)