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)
|
||||
{
|
||||
// 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;
|
||||
|
||||
@@ -11,6 +11,7 @@ rcd-component-change-mode = The RCD is now set to {$mode} mode.
|
||||
|
||||
rcd-component-no-ammo-message = The RCD is out of ammo!
|
||||
rcd-component-tile-obstructed-message = That tile is obstructed!
|
||||
rcd-component-tile-indestructible-message = That tile can't be destroyed!
|
||||
rcd-component-deconstruct-target-not-on-whitelist-message = You can't deconstruct that!
|
||||
rcd-component-cannot-build-floor-tile-not-empty-message = You can only build a floor on space!
|
||||
rcd-component-cannot-build-wall-tile-not-empty-message = You cannot build a wall on space!
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
collection: FootstepAsteroid
|
||||
heatCapacity: 10000
|
||||
weather: true
|
||||
indestructible: true
|
||||
|
||||
# Desert
|
||||
- type: tile
|
||||
@@ -22,6 +23,7 @@
|
||||
collection: FootstepAsteroid
|
||||
heatCapacity: 10000
|
||||
weather: true
|
||||
indestructible: true
|
||||
|
||||
- type: tile
|
||||
id: FloorLowDesert
|
||||
@@ -35,6 +37,7 @@
|
||||
collection: FootstepAsteroid
|
||||
heatCapacity: 10000
|
||||
weather: true
|
||||
indestructible: true
|
||||
|
||||
# Grass
|
||||
- type: tile
|
||||
@@ -60,6 +63,7 @@
|
||||
itemDrop: FloorTileItemGrass
|
||||
heatCapacity: 10000
|
||||
weather: true
|
||||
indestructible: true
|
||||
|
||||
# Lava
|
||||
- type: tile
|
||||
@@ -72,6 +76,7 @@
|
||||
collection: FootstepAsteroid
|
||||
heatCapacity: 10000
|
||||
weather: true
|
||||
indestructible: true
|
||||
|
||||
# Snow
|
||||
- type: tile
|
||||
@@ -91,5 +96,6 @@
|
||||
friction: 0.20
|
||||
heatCapacity: 10000
|
||||
weather: true
|
||||
indestructible: true
|
||||
|
||||
# Wasteland
|
||||
|
||||
Reference in New Issue
Block a user