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:
@@ -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))
|
||||||
|
|||||||
@@ -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)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -5,3 +5,4 @@
|
|||||||
friction: 0
|
friction: 0
|
||||||
is_subfloor: true
|
is_subfloor: true
|
||||||
is_space: true
|
is_space: true
|
||||||
|
sturdy: false
|
||||||
|
|||||||
Reference in New Issue
Block a user