Even more resolve removals.

This commit is contained in:
Vera Aguilera Puerto
2021-12-08 17:32:32 +01:00
parent 684cb76173
commit cdc8336695
61 changed files with 364 additions and 278 deletions

View File

@@ -12,6 +12,7 @@ namespace Content.Server.Spawners.Components
[RegisterComponent]
public class ConditionalSpawnerComponent : Component, IMapInit
{
[Dependency] private readonly IEntityManager _entMan = default!;
[Dependency] private readonly IRobustRandom _robustRandom = default!;
public override string Name => "ConditionalSpawner";
@@ -61,8 +62,8 @@ namespace Content.Server.Spawners.Components
return;
}
if(!((!IoCManager.Resolve<IEntityManager>().EntityExists(Owner) ? EntityLifeStage.Deleted : IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(Owner).EntityLifeStage) >= EntityLifeStage.Deleted))
IoCManager.Resolve<IEntityManager>().SpawnEntity(_robustRandom.Pick(Prototypes), IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(Owner).Coordinates);
if(_entMan.Deleted(Owner))
_entMan.SpawnEntity(_robustRandom.Pick(Prototypes), _entMan.GetComponent<TransformComponent>(Owner).Coordinates);
}
public virtual void MapInit()