This commit is contained in:
ShadowCommander
2023-03-26 11:31:13 -07:00
committed by GitHub
parent 0e5dc41fe8
commit bfc4da9377
85 changed files with 1150 additions and 684 deletions

View File

@@ -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"})";