prevent rcd destroying planets (#16120)
Co-authored-by: deltanedas <@deltanedas:kde.org>
This commit is contained in:
@@ -75,6 +75,11 @@ namespace Content.Shared.Maps
|
||||
/// </summary>
|
||||
[DataField("weather")] public bool Weather = false;
|
||||
|
||||
/// <summary>
|
||||
/// Is this tile immune to RCD deconstruct.
|
||||
/// </summary>
|
||||
[DataField("indestructible")] public bool Indestructible = false;
|
||||
|
||||
public void AssignTileId(ushort id)
|
||||
{
|
||||
TileId = id;
|
||||
|
||||
@@ -237,14 +237,25 @@ public sealed class RCDSystem : EntitySystem
|
||||
if (tile.Tile.IsEmpty)
|
||||
return false;
|
||||
|
||||
//They tried to decon a turf but the turf is blocked
|
||||
if (target == null && IsTileBlocked(tile))
|
||||
//They tried to decon a turf but...
|
||||
if (target == null)
|
||||
{
|
||||
_popup.PopupClient(Loc.GetString("rcd-component-tile-obstructed-message"), uid, user);
|
||||
return false;
|
||||
// the turf is blocked
|
||||
if (IsTileBlocked(tile))
|
||||
{
|
||||
_popup.PopupClient(Loc.GetString("rcd-component-tile-obstructed-message"), uid, user);
|
||||
return false;
|
||||
}
|
||||
// the turf can't be destroyed (planet probably)
|
||||
var tileDef = (ContentTileDefinition) _tileDefMan[tile.Tile.TypeId];
|
||||
if (tileDef.Indestructible)
|
||||
{
|
||||
_popup.PopupClient(Loc.GetString("rcd-component-tile-indestructible-message"), uid, user);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
//They tried to decon a non-turf but it's not in the whitelist
|
||||
if (target != null && !_tag.HasTag(target.Value, "RCDDeconstructWhitelist"))
|
||||
else if (!_tag.HasTag(target.Value, "RCDDeconstructWhitelist"))
|
||||
{
|
||||
_popup.PopupClient(Loc.GetString("rcd-component-deconstruct-target-not-on-whitelist-message"), uid, user);
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user