This commit is contained in:
ShadowCommander
2023-06-18 11:33:19 -07:00
committed by GitHub
parent 8a943fb374
commit dd7032a860
85 changed files with 1432 additions and 711 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)
@@ -172,7 +172,7 @@ namespace Content.Server.Ghost
private void OnPlayerDetached(EntityUid uid, GhostComponent component, PlayerDetachedEvent args)
{
QueueDel(uid);
DeleteEntity(uid);
}
private void OnGhostWarpsRequest(GhostWarpsRequestEvent msg, EntitySessionEventArgs 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,9 +236,9 @@ 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);
QueueDel(uid);
}
private IEnumerable<GhostWarp> GetLocationWarps()
@@ -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"})";