Fix 3000 errors

This commit is contained in:
DrSmugleaf
2021-12-05 18:09:01 +01:00
parent 2bfec7ec62
commit 2a3b7d809d
569 changed files with 2979 additions and 3280 deletions

View File

@@ -1,9 +1,7 @@
using System.Threading.Tasks;
using Content.Server.Chemistry.EntitySystems;
using Content.Server.DoAfter;
using Content.Server.Fluids.EntitySystems;
using Content.Shared.Chemistry.Components;
using Content.Shared.Chemistry.Reagent;
using Content.Shared.FixedPoint;
using Content.Shared.Interaction;
using Content.Shared.Interaction.Helpers;
@@ -143,7 +141,7 @@ namespace Content.Server.Fluids.Components
// is the puddle cleaned?
if (puddleSolution.TotalVolume - transferAmount <= 0)
{
IoCManager.Resolve<IEntityManager>().DeleteEntity((EntityUid) puddleComponent.Owner);
IoCManager.Resolve<IEntityManager>().DeleteEntity(puddleComponent.Owner);
// After cleaning the puddle, make a new puddle with solution from the mop as a "wet floor". Then evaporate it slowly.
// we do this WITHOUT adding to the existing puddle. Otherwise we have might have water puddles with the vomit sprite.

View File

@@ -28,32 +28,12 @@ namespace Content.Server.Fluids.Components
/// <param name="sound">Play the spill sound.</param>
/// <returns>The puddle if one was created, null otherwise.</returns>
/// <param name="combine">Whether to attempt to merge with existing puddles</param>
public static PuddleComponent? SpillAt(this Solution solution, IEntity entity, string prototype,
public static PuddleComponent? SpillAt(this Solution solution, EntityUid entity, string prototype,
bool sound = true, bool combine = true)
{
return solution.SpillAt(IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(entity).Coordinates, prototype, sound, combine: combine);
}
/// <summary>
/// Spills the specified solution at the entity's location if possible.
/// </summary>
/// <param name="entity">
/// The entity to use as a location to spill the solution at.
/// </param>
/// <param name="solution">Initial solution for the prototype.</param>
/// <param name="prototype">The prototype to use.</param>
/// <param name="sound">Play the spill sound.</param>
/// <param name="entityManager"></param>
/// <param name="combine">Whether to attempt to merge with existing puddles</param>
/// <returns>The puddle if one was created, null otherwise.</returns>
public static PuddleComponent? SpillAt(this Solution solution, EntityUid entity, string prototype,
bool sound = true, IEntityManager? entityManager = null, bool combine = true)
{
entityManager ??= IoCManager.Resolve<IEntityManager>();
return solution.SpillAt(entityManager.GetComponent<TransformComponent>(entity).Coordinates, prototype, sound, combine: combine);
}
/// <summary>
/// Spills the specified solution at the entity's location if possible.
/// </summary>
@@ -66,7 +46,7 @@ namespace Content.Server.Fluids.Components
/// <param name="sound">Play the spill sound.</param>
/// <param name="combine">Whether to attempt to merge with existing puddles</param>
/// <returns>True if a puddle was created, false otherwise.</returns>
public static bool TrySpillAt(this Solution solution, IEntity entity, string prototype,
public static bool TrySpillAt(this Solution solution, EntityUid entity, string prototype,
[NotNullWhen(true)] out PuddleComponent? puddle, bool sound = true, bool combine = true)
{
puddle = solution.SpillAt(entity, prototype, sound, combine: combine);

View File

@@ -1,6 +1,5 @@
using Content.Server.Chemistry.EntitySystems;
using Content.Server.Fluids.Components;
using Content.Shared.Chemistry.Reagent;
using Content.Shared.FixedPoint;
using JetBrains.Annotations;
using Robust.Shared.GameObjects;
@@ -20,7 +19,7 @@ namespace Content.Server.Fluids.EntitySystems
var queueDelete = new RemQueue<EvaporationComponent>();
foreach (var evaporationComponent in EntityManager.EntityQuery<EvaporationComponent>())
{
var uid = (EntityUid) evaporationComponent.Owner;
var uid = evaporationComponent.Owner;
evaporationComponent.Accumulator += frameTime;
if (!_solutionContainerSystem.TryGetSolution(uid, evaporationComponent.SolutionName, out var solution))

View File

@@ -5,9 +5,7 @@ using System.Linq;
using Content.Server.Chemistry.EntitySystems;
using Content.Server.Construction.Components;
using Content.Server.Fluids.Components;
using Content.Shared.Administration.Logs;
using Content.Shared.Chemistry.Components;
using Content.Shared.Chemistry.Reagent;
using Content.Shared.Database;
using Content.Shared.Directions;
using Content.Shared.Examine;
@@ -26,7 +24,6 @@ using Robust.Shared.Map;
using Robust.Shared.Maths;
using Robust.Shared.Physics;
using Robust.Shared.Player;
using Robust.Shared.Prototypes;
namespace Content.Server.Fluids.EntitySystems
{
@@ -61,7 +58,7 @@ namespace Content.Server.Fluids.EntitySystems
private void UpdateVisuals(EntityUid uid, PuddleComponent puddleComponent)
{
if ((!IoCManager.Resolve<IEntityManager>().EntityExists(puddleComponent.Owner) ? EntityLifeStage.Deleted : IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(puddleComponent.Owner).EntityLifeStage) >= EntityLifeStage.Deleted || EmptyHolder(uid, puddleComponent) ||
if ((!EntityManager.EntityExists(puddleComponent.Owner) ? EntityLifeStage.Deleted : EntityManager.GetComponent<MetaDataComponent>(puddleComponent.Owner).EntityLifeStage) >= EntityLifeStage.Deleted || EmptyHolder(uid, puddleComponent) ||
!EntityManager.TryGetComponent<AppearanceComponent>(uid, out var appearanceComponent))
{
return;
@@ -106,7 +103,7 @@ namespace Content.Server.Fluids.EntitySystems
verb.Text = Loc.GetString("spill-target-verb-get-data-text");
// TODO VERB ICONS spill icon? pouring out a glass/beaker?
verb.Act = () => _solutionContainerSystem.SplitSolution(args.Target,
solution, solution.DrainAvailable).SpillAt(IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(args.Target).Coordinates, "PuddleSmear");
solution, solution.DrainAvailable).SpillAt(EntityManager.GetComponent<TransformComponent>(args.Target).Coordinates, "PuddleSmear");
verb.Impact = LogImpact.Medium; // dangerous reagent reaction are logged separately.
args.Verbs.Add(verb);
}
@@ -121,10 +118,10 @@ namespace Content.Server.Fluids.EntitySystems
private void OnUnanchored(EntityUid uid, PuddleComponent puddle, UnanchoredEvent unanchoredEvent)
{
if (!IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(puddle.Owner).Anchored)
if (!EntityManager.GetComponent<TransformComponent>(puddle.Owner).Anchored)
return;
IoCManager.Resolve<IEntityManager>().QueueDeleteEntity((EntityUid) puddle.Owner);
EntityManager.QueueDeleteEntity(puddle.Owner);
}
/// <summary>
@@ -288,11 +285,11 @@ namespace Content.Server.Fluids.EntitySystems
puddle = default;
// We're most likely in space, do nothing.
if (!IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(puddleComponent.Owner).GridID.IsValid())
if (!EntityManager.GetComponent<TransformComponent>(puddleComponent.Owner).GridID.IsValid())
return false;
var mapGrid = _mapManager.GetGrid(IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(puddleComponent.Owner).GridID);
var coords = IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(puddleComponent.Owner).Coordinates;
var mapGrid = _mapManager.GetGrid(EntityManager.GetComponent<TransformComponent>(puddleComponent.Owner).GridID);
var coords = EntityManager.GetComponent<TransformComponent>(puddleComponent.Owner).Coordinates;
if (!coords.Offset(direction).TryGetTileRef(out var tile))
{
@@ -305,7 +302,7 @@ namespace Content.Server.Fluids.EntitySystems
return false;
}
if (!IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(puddleComponent.Owner).Anchored)
if (!EntityManager.GetComponent<TransformComponent>(puddleComponent.Owner).Anchored)
return false;
foreach (var entity in mapGrid.GetInDir(coords, direction))
@@ -330,9 +327,10 @@ namespace Content.Server.Fluids.EntitySystems
puddle ??= () =>
{
IEntity tempQualifier = IoCManager.Resolve<IEntityManager>().SpawnEntity(IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(puddleComponent.Owner).EntityPrototype?.ID,
var id = EntityManager.SpawnEntity(
EntityManager.GetComponent<MetaDataComponent>(puddleComponent.Owner).EntityPrototype?.ID,
mapGrid.DirectionToGrid(coords, direction));
return IoCManager.Resolve<IEntityManager>().GetComponent<PuddleComponent>(tempQualifier);
return EntityManager.GetComponent<PuddleComponent>(id);
};
return true;