Replace resolve dependency with attribute in components (#1995)
* Replace resolve dependency with attribute in components * Add changes that went missing in translation
This commit is contained in:
@@ -49,6 +49,8 @@ namespace Content.Server.GameObjects.Components.Fluids
|
||||
// to check for low volumes for evaporation or whatever
|
||||
|
||||
[Dependency] private readonly IMapManager _mapManager = default!;
|
||||
[Dependency] private readonly IRobustRandom _random = default!;
|
||||
[Dependency] private readonly IEntityManager _entityManager = default!;
|
||||
|
||||
public override string Name => "Puddle";
|
||||
|
||||
@@ -134,8 +136,7 @@ namespace Content.Server.GameObjects.Components.Fluids
|
||||
// Random sprite state set server-side so it's consistent across all clients
|
||||
_spriteComponent = Owner.EnsureComponent<SpriteComponent>();
|
||||
|
||||
var robustRandom = IoCManager.Resolve<IRobustRandom>();
|
||||
var randomVariant = robustRandom.Next(0, _spriteVariants - 1);
|
||||
var randomVariant = _random.Next(0, _spriteVariants - 1);
|
||||
|
||||
if (_spriteComponent.BaseRSIPath != null)
|
||||
{
|
||||
@@ -388,8 +389,7 @@ namespace Content.Server.GameObjects.Components.Fluids
|
||||
if (puddle == default)
|
||||
{
|
||||
var grid = _snapGrid.DirectionToGrid(direction);
|
||||
var entityManager = IoCManager.Resolve<IEntityManager>();
|
||||
puddle = () => entityManager.SpawnEntity(Owner.Prototype.ID, grid).GetComponent<PuddleComponent>();
|
||||
puddle = () => _entityManager.SpawnEntity(Owner.Prototype.ID, grid).GetComponent<PuddleComponent>();
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user