Stops InteractionOutline when the mouse is off screen. (#6191)

This commit is contained in:
ShadowCommander
2022-01-16 12:21:08 -08:00
committed by GitHub
parent 4c5c934f8e
commit fc8da53fba

View File

@@ -52,7 +52,8 @@ public sealed class InteractionOutlineSystem : EntitySystem
EntityUid? entityToClick = null; EntityUid? entityToClick = null;
var renderScale = 1; var renderScale = 1;
if (_uiManager.CurrentlyHovered is IViewportControl vp) if (_uiManager.CurrentlyHovered is IViewportControl vp
&& _inputManager.MouseScreenPosition.IsValid)
{ {
var mousePosWorld = vp.ScreenToMap(_inputManager.MouseScreenPosition.Position); var mousePosWorld = vp.ScreenToMap(_inputManager.MouseScreenPosition.Position);
entityToClick = screen.GetEntityUnderPosition(mousePosWorld); entityToClick = screen.GetEntityUnderPosition(mousePosWorld);