Add explosive cord. (#25875)
This commit is contained in:
@@ -4,6 +4,7 @@ using Content.Shared.Database;
|
||||
using Content.Shared.Interaction;
|
||||
using Content.Shared.Maps;
|
||||
using Content.Shared.Stacks;
|
||||
using Content.Shared.Whitelist;
|
||||
using Robust.Shared.Map.Components;
|
||||
|
||||
namespace Content.Server.Power.EntitySystems;
|
||||
@@ -13,6 +14,7 @@ public sealed partial class CableSystem
|
||||
[Dependency] private readonly IAdminLogManager _adminLogger = default!;
|
||||
[Dependency] private readonly SharedTransformSystem _transform = default!;
|
||||
[Dependency] private readonly SharedMapSystem _map = default!;
|
||||
[Dependency] private readonly EntityWhitelistSystem _whitelistSystem = default!;
|
||||
|
||||
private void InitializeCablePlacer()
|
||||
{
|
||||
@@ -35,12 +37,14 @@ public sealed partial class CableSystem
|
||||
var snapPos = _map.TileIndicesFor((gridUid, grid), args.ClickLocation);
|
||||
var tileDef = (ContentTileDefinition)_tileManager[_map.GetTileRef(gridUid, grid, snapPos).Tile.TypeId];
|
||||
|
||||
if (!tileDef.IsSubFloor || !tileDef.Sturdy)
|
||||
if ((!component.OverTile && !tileDef.IsSubFloor) || !tileDef.Sturdy)
|
||||
return;
|
||||
|
||||
|
||||
foreach (var anchored in _map.GetAnchoredEntities((gridUid, grid), snapPos))
|
||||
{
|
||||
if (_whitelistSystem.IsBlacklistPass(component.Blacklist, anchored))
|
||||
return;
|
||||
|
||||
if (TryComp<CableComponent>(anchored, out var wire) && wire.CableType == component.BlockingCableType)
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user