From 9c6c6a797ab57477a76bc1006bda0d480dfb9ba5 Mon Sep 17 00:00:00 2001 From: Leon Friedrich <60421075+ElectroJr@users.noreply.github.com> Date: Tue, 14 Feb 2023 15:46:44 +1300 Subject: [PATCH] Remove reference to deleted mind (#14101) --- Content.Server/GameTicking/GameTicker.GamePreset.cs | 3 +++ Content.Server/Mind/MindSystem.cs | 1 + 2 files changed, 4 insertions(+) diff --git a/Content.Server/GameTicking/GameTicker.GamePreset.cs b/Content.Server/GameTicking/GameTicker.GamePreset.cs index cedc88cba4..7956a3d7d8 100644 --- a/Content.Server/GameTicking/GameTicker.GamePreset.cs +++ b/Content.Server/GameTicking/GameTicker.GamePreset.cs @@ -183,6 +183,9 @@ namespace Content.Server.GameTicking ? Transform(playerEntity.Value).Coordinates : GetObserverSpawnPoint(); + if (position == default) + return false; + // Ok, so, this is the master place for the logic for if ghosting is "too cheaty" to allow returning. // There's no reason at this time to move it to any other place, especially given that the 'side effects required' situations would also have to be moved. // + If CharacterDeadPhysically applies, we're physically dead. Therefore, ghosting OK, and we can return (this is critical for gibbing) diff --git a/Content.Server/Mind/MindSystem.cs b/Content.Server/Mind/MindSystem.cs index ca4851b652..549f85e108 100644 --- a/Content.Server/Mind/MindSystem.cs +++ b/Content.Server/Mind/MindSystem.cs @@ -107,6 +107,7 @@ public sealed class MindSystem : EntitySystem { // This should be an error, if it didn't cause tests to start erroring when they delete a player. Logger.WarningS("mind", $"Entity \"{ToPrettyString(uid)}\" for {mind.Mind?.CharacterName} was deleted, and no applicable spawn location is available."); + mind.Mind?.TransferTo(null); return; } -- 2.52.0