Cleaned up obsolete properties from MobStateComponent (#13097)

Co-authored-by: Jezithyr <Jezithyr@gmail.com>
This commit is contained in:
Jezithyr
2022-12-19 19:25:35 -08:00
committed by GitHub
parent 7259acfb18
commit 5f9b4adf47
22 changed files with 91 additions and 78 deletions

View File

@@ -13,16 +13,15 @@ namespace Content.Server.Objectives.Conditions
{
public override IObjectiveCondition GetAssigned(Mind.Mind mind)
{
var entityMgr = IoCManager.Resolve<IEntityManager>();
var allHumans = entityMgr.EntityQuery<MindComponent>(true).Where(mc =>
var allHumans = EntityManager.EntityQuery<MindComponent>(true).Where(mc =>
{
var entity = mc.Mind?.OwnedEntity;
if (entity == default)
return false;
return entityMgr.TryGetComponent(entity, out MobStateComponent? mobState) &&
mobState.IsAlive() &&
return EntityManager.TryGetComponent(entity, out MobStateComponent? mobState) &&
MobStateSystem.IsAlive(entity.Value, mobState) &&
mc.Mind != mind;
}).Select(mc => mc.Mind).ToList();