diff --git a/Content.Server/Crayon/CrayonComponent.cs b/Content.Server/Crayon/CrayonComponent.cs index e877a8d65c..53f9384b66 100644 --- a/Content.Server/Crayon/CrayonComponent.cs +++ b/Content.Server/Crayon/CrayonComponent.cs @@ -124,9 +124,13 @@ namespace Content.Server.Crayon return true; } - var entityManager = IoCManager.Resolve(); + if (!eventArgs.ClickLocation.IsValid(Owner.EntityManager)) + { + eventArgs.User.PopupMessage(Loc.GetString("crayon-interact-invalid-location")); + return true; + } - var entity = entityManager.SpawnEntity("CrayonDecal", eventArgs.ClickLocation); + var entity = Owner.EntityManager.SpawnEntity("CrayonDecal", eventArgs.ClickLocation); if (entity.TryGetComponent(out AppearanceComponent? appearance)) { appearance.SetData(CrayonVisuals.State, SelectedState); diff --git a/Resources/Locale/en-US/crayon/crayon-component.ftl b/Resources/Locale/en-US/crayon/crayon-component.ftl index 34fe271be1..af8e0a7cdb 100644 --- a/Resources/Locale/en-US/crayon/crayon-component.ftl +++ b/Resources/Locale/en-US/crayon/crayon-component.ftl @@ -3,6 +3,7 @@ crayon-drawing-label = Drawing: [color={$color}]{$state}[/color] ({$charges}/{$capacity}) crayon-interact-not-enough-left-text = Not enough left. +crayon-interact-invalid-location = Can't reach there! ## UI -crayon-window-title = Crayon \ No newline at end of file +crayon-window-title = Crayon