From 86e2f2005e026d16e40d3bd1f3c7ba5dcbd61b19 Mon Sep 17 00:00:00 2001 From: moonheart08 Date: Sat, 23 Oct 2021 19:32:33 -0500 Subject: [PATCH] Allows placing cables on lattices. (#4984) Adds a "sturdy" tile flag, that in the future could be used by construction/etc to figure out if it's safe to build on a tile. (For example water isn't space, but it's not a sturdy building surface!) --- Content.Server/Power/Components/CablePlacerComponent.cs | 2 +- Content.Shared/Maps/ContentTileDefinition.cs | 1 + Resources/Prototypes/Tiles/space.yml | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Content.Server/Power/Components/CablePlacerComponent.cs b/Content.Server/Power/Components/CablePlacerComponent.cs index e7e0143b79..d738449aaf 100644 --- a/Content.Server/Power/Components/CablePlacerComponent.cs +++ b/Content.Server/Power/Components/CablePlacerComponent.cs @@ -46,7 +46,7 @@ namespace Content.Server.Power.Components var snapPos = grid.TileIndicesFor(eventArgs.ClickLocation); var tileDef = grid.GetTileRef(snapPos).Tile.GetContentTileDefinition(); - if(!tileDef.IsSubFloor || tileDef.IsSpace) + if(!tileDef.IsSubFloor || !tileDef.Sturdy) return false; foreach (var anchored in grid.GetAnchoredEntities(snapPos)) diff --git a/Content.Shared/Maps/ContentTileDefinition.cs b/Content.Shared/Maps/ContentTileDefinition.cs index 6f82ad0768..199659901e 100644 --- a/Content.Shared/Maps/ContentTileDefinition.cs +++ b/Content.Shared/Maps/ContentTileDefinition.cs @@ -42,6 +42,7 @@ namespace Content.Shared.Maps public string ItemDropPrototypeName { get; } = "FloorTileItemSteel"; [DataField("is_space")] public bool IsSpace { get; private set; } + [DataField("sturdy")] public bool Sturdy { get; private set; } = true; public void AssignTileId(ushort id) { diff --git a/Resources/Prototypes/Tiles/space.yml b/Resources/Prototypes/Tiles/space.yml index 6a0be3dc83..95bdf38599 100644 --- a/Resources/Prototypes/Tiles/space.yml +++ b/Resources/Prototypes/Tiles/space.yml @@ -5,3 +5,4 @@ friction: 0 is_subfloor: true is_space: true + sturdy: false