From 96cb951555347f47f886d1f7524a8e8a92292eff Mon Sep 17 00:00:00 2001 From: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> Date: Mon, 10 Feb 2025 22:58:05 +1100 Subject: [PATCH] Tweak viewport nullspace check (#35037) * Tweak viewport nullspace check WorldPos being 0,0 is sussy-a. * a --- .../Systems/Viewport/ViewportUIController.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Content.Client/UserInterface/Systems/Viewport/ViewportUIController.cs b/Content.Client/UserInterface/Systems/Viewport/ViewportUIController.cs index ffee14ad9a..338b5fc7e5 100644 --- a/Content.Client/UserInterface/Systems/Viewport/ViewportUIController.cs +++ b/Content.Client/UserInterface/Systems/Viewport/ViewportUIController.cs @@ -6,6 +6,7 @@ using Robust.Client.Player; using Robust.Client.UserInterface; using Robust.Client.UserInterface.Controllers; using Robust.Shared.Configuration; +using Robust.Shared.Map; using Robust.Shared.Timing; namespace Content.Client.UserInterface.Systems.Viewport; @@ -95,8 +96,11 @@ public sealed class ViewportUIController : UIController _entMan.TryGetComponent(ent, out EyeComponent? eye); if (eye?.Eye == _eyeManager.CurrentEye - && (_transformSystem is null || _transformSystem.GetWorldPosition(ent.Value) == default)) - return; // nothing to worry about, the player is just in null space... actually that is probably a problem? + && _entMan.GetComponent(ent.Value).MapID == MapId.Nullspace) + { + // nothing to worry about, the player is just in null space... actually that is probably a problem? + return; + } // Currently, this shouldn't happen. This likely happened because the main eye was set to null. When this // does happen it can create hard to troubleshoot bugs, so lets print some helpful warnings: -- 2.51.2