diff --git a/Content.Server/Construction/ConstructionSystem.cs b/Content.Server/Construction/ConstructionSystem.cs index 9da63b4765..12b708bb8a 100644 --- a/Content.Server/Construction/ConstructionSystem.cs +++ b/Content.Server/Construction/ConstructionSystem.cs @@ -395,6 +395,7 @@ namespace Content.Server.Construction private async void HandleStartStructureConstruction(TryStartStructureConstructionMessage ev, EntitySessionEventArgs args) { + if (!_prototypeManager.TryIndex(ev.PrototypeName, out ConstructionPrototype? constructionPrototype)) { Logger.Error($"Tried to start construction of invalid recipe '{ev.PrototypeName}'!"); @@ -417,6 +418,12 @@ namespace Content.Server.Construction return; } + if (user.IsInContainer()) + { + user.PopupMessageCursor(Loc.GetString("construction-system-inside-container")); + return; + } + var startNode = constructionGraph.Nodes[constructionPrototype.StartNode]; var targetNode = constructionGraph.Nodes[constructionPrototype.TargetNode]; var pathFind = constructionGraph.Path(startNode.Name, targetNode.Name); diff --git a/Resources/Locale/en-US/construction/construction-system.ftl b/Resources/Locale/en-US/construction/construction-system.ftl index aa3dda391c..6ba8ae7813 100644 --- a/Resources/Locale/en-US/construction/construction-system.ftl +++ b/Resources/Locale/en-US/construction/construction-system.ftl @@ -2,4 +2,5 @@ construction-system-construct-cannot-start-another-construction = You can't start another construction now! construction-system-construct-no-materials = You don't have the materials to build that! -construction-system-already-building = You are already building that! \ No newline at end of file +construction-system-already-building = You are already building that! +construction-system-inside-container = You can't build while you're there!