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

@@ -278,7 +278,7 @@ namespace Content.Server.GameTicking
if (mind.CharacterName != null)
playerIcName = mind.CharacterName;
else if (mind.CurrentEntity != null)
playerIcName = IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(mind.CurrentEntity.Value).EntityName;
playerIcName = EntityManager.GetComponent<MetaDataComponent>(mind.CurrentEntity.Value).EntityName;
var playerEndRoundInfo = new RoundEndMessageEvent.RoundEndPlayerInfo()
{
@@ -369,7 +369,7 @@ namespace Content.Server.GameTicking
{
// TODO: Maybe something less naive here?
// FIXME: Actually, definitely.
IoCManager.Resolve<IEntityManager>().DeleteEntity(entity);
EntityManager.DeleteEntity(entity);
}
_mapManager.Restart();

View File

@@ -76,8 +76,7 @@ namespace Content.Server.GameTicking.Presets
}
}
var entityManager = IoCManager.Resolve<IEntityManager>();
var ghost = entityManager.SpawnEntity("MobObserver", position.ToMap(entityManager));
var ghost = entities.SpawnEntity("MobObserver", position.ToMap(entities));
// Try setting the ghost entity name to either the character name or the player name.
// If all else fails, it'll default to the default entity prototype name, "observer".
@@ -87,7 +86,7 @@ namespace Content.Server.GameTicking.Presets
else if (!string.IsNullOrWhiteSpace(mind.Session?.Name))
entities.GetComponent<MetaDataComponent>(ghost).EntityName = mind.Session.Name;
var ghostComponent = IoCManager.Resolve<IEntityManager>().GetComponent<GhostComponent>(ghost);
var ghostComponent = entities.GetComponent<GhostComponent>(ghost);
if (mind.TimeOfDeath.HasValue)
{