Bunch more resolves removed.

This commit is contained in:
Vera Aguilera Puerto
2021-12-08 17:17:12 +01:00
parent ba736f70df
commit 684cb76173
38 changed files with 267 additions and 208 deletions

View File

@@ -20,6 +20,8 @@ namespace Content.Server.Extinguisher
[RegisterComponent]
public class FireExtinguisherComponent : SharedFireExtinguisherComponent, IAfterInteract, IUse, IActivate, IDropped
{
[Dependency] private readonly IEntityManager _entMan = default!;
public override string Name => "FireExtinguisher";
[DataField("refillSound")]
@@ -58,7 +60,7 @@ namespace Content.Server.Extinguisher
}
if (eventArgs.Target is not {Valid: true} target ||
!IoCManager.Resolve<IEntityManager>().HasComponent<ReagentTankComponent>(target) ||
!_entMan.HasComponent<ReagentTankComponent>(target) ||
!solutionContainerSystem.TryGetDrainableSolution(target, out var targetSolution) ||
!solutionContainerSystem.TryGetDrainableSolution(Owner, out var container))
{
@@ -103,13 +105,13 @@ namespace Content.Server.Extinguisher
_safety = state;
if (IoCManager.Resolve<IEntityManager>().TryGetComponent(Owner, out AppearanceComponent? appearance))
if (_entMan.TryGetComponent(Owner, out AppearanceComponent? appearance))
appearance.SetData(FireExtinguisherVisuals.Safety, _safety);
}
void IDropped.Dropped(DroppedEventArgs eventArgs)
{
if (_hasSafety && IoCManager.Resolve<IEntityManager>().TryGetComponent(Owner, out AppearanceComponent? appearance))
if (_hasSafety && _entMan.TryGetComponent(Owner, out AppearanceComponent? appearance))
appearance.SetData(FireExtinguisherVisuals.Safety, _safety);
}
}