Mind ecs (#14412)
This commit is contained in:
@@ -92,13 +92,13 @@ namespace Content.Server.Ghost
|
||||
if (EntityManager.HasComponent<VisitingMindComponent>(uid))
|
||||
return;
|
||||
|
||||
if (!EntityManager.TryGetComponent<MindComponent>(uid, out var mind) || !mind.HasMind || mind.Mind!.IsVisitingEntity)
|
||||
if (!EntityManager.TryGetComponent<MindContainerComponent>(uid, out var mind) || !mind.HasMind || mind.Mind.IsVisitingEntity)
|
||||
return;
|
||||
|
||||
if (component.MustBeDead && (_mobState.IsAlive(uid) || _mobState.IsCritical(uid)))
|
||||
return;
|
||||
|
||||
_ticker.OnGhostAttempt(mind.Mind!, component.CanReturn);
|
||||
_ticker.OnGhostAttempt(mind.Mind, component.CanReturn);
|
||||
}
|
||||
|
||||
private void OnGhostStartup(EntityUid uid, GhostComponent component, ComponentStartup args)
|
||||
@@ -199,7 +199,7 @@ namespace Content.Server.Ghost
|
||||
return;
|
||||
}
|
||||
|
||||
actor.PlayerSession.ContentData()!.Mind?.UnVisit();
|
||||
_mindSystem.UnVisit(actor.PlayerSession.ContentData()!.Mind);
|
||||
}
|
||||
|
||||
private void OnGhostWarpToTargetRequest(GhostWarpToTargetRequestEvent msg, EntitySessionEventArgs args)
|
||||
@@ -236,7 +236,7 @@ namespace Content.Server.Ghost
|
||||
if (Deleted(uid) || Terminating(uid))
|
||||
return;
|
||||
|
||||
if (EntityManager.TryGetComponent<MindComponent?>(uid, out var mind))
|
||||
if (EntityManager.TryGetComponent<MindContainerComponent?>(uid, out var mind))
|
||||
_mindSystem.SetGhostOnShutdown(uid, false, mind);
|
||||
EntityManager.DeleteEntity(uid);
|
||||
}
|
||||
@@ -260,7 +260,7 @@ namespace Content.Server.Ghost
|
||||
{
|
||||
if (attached == except) continue;
|
||||
|
||||
TryComp<MindComponent>(attached, out var mind);
|
||||
TryComp<MindContainerComponent>(attached, out var mind);
|
||||
|
||||
string playerInfo = $"{EntityManager.GetComponent<MetaDataComponent>(attached).EntityName} ({mind?.Mind?.CurrentJob?.Name ?? "Unknown"})";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user