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!)
This commit is contained in:
moonheart08
2021-10-23 19:32:33 -05:00
committed by GitHub
parent ee3d498382
commit 86e2f2005e
3 changed files with 3 additions and 1 deletions

View File

@@ -46,7 +46,7 @@ namespace Content.Server.Power.Components
var snapPos = grid.TileIndicesFor(eventArgs.ClickLocation); var snapPos = grid.TileIndicesFor(eventArgs.ClickLocation);
var tileDef = grid.GetTileRef(snapPos).Tile.GetContentTileDefinition(); var tileDef = grid.GetTileRef(snapPos).Tile.GetContentTileDefinition();
if(!tileDef.IsSubFloor || tileDef.IsSpace) if(!tileDef.IsSubFloor || !tileDef.Sturdy)
return false; return false;
foreach (var anchored in grid.GetAnchoredEntities(snapPos)) foreach (var anchored in grid.GetAnchoredEntities(snapPos))

View File

@@ -42,6 +42,7 @@ namespace Content.Shared.Maps
public string ItemDropPrototypeName { get; } = "FloorTileItemSteel"; public string ItemDropPrototypeName { get; } = "FloorTileItemSteel";
[DataField("is_space")] public bool IsSpace { get; private set; } [DataField("is_space")] public bool IsSpace { get; private set; }
[DataField("sturdy")] public bool Sturdy { get; private set; } = true;
public void AssignTileId(ushort id) public void AssignTileId(ushort id)
{ {

View File

@@ -5,3 +5,4 @@
friction: 0 friction: 0
is_subfloor: true is_subfloor: true
is_space: true is_space: true
sturdy: false