Allow station tiles to be placed on solid ground and other platings. (#38898)

* WORK IN PROGRESS 1

* ITS ALIVE, ALIVE!!!!

* clean up

* WIP 1

* fix small oversight

* big diff of doom

* added CVAR to tile history stack size

* component time

* filescoped namespaces + remove redundant nametag

* fix silly little mistakes

* typo

* TileStacksTest

* bweeeeeeh :P

* nuke cvar

* :3

* WIP2025

* Fix submodule

* It's beginning to look a lot like Christmas

* It's the Most Wonderful Time of the Year

* tiny fix

* fixed extra spacing on yaml

* slightly improve tilestacking test

* Part 1 out of 2 (part 2 tomorrow)

* Part 2

* add a simple tile construction test for tilestacking

* guh

* address reviews (no documentation yet)

* documentation be upon ye

* remove extra spaces

* prediction fix

* dirt

* oops :p

---------

Co-authored-by: Killerqu00 <killerqueen1777@gmail.com>
Co-authored-by: Killerqu00 <47712032+Killerqu00@users.noreply.github.com>
Co-authored-by: ScarKy0 <scarky0@onet.eu>
This commit is contained in:
Velken
2026-04-04 16:57:53 +02:00
committed by BarryNorfolk
co-authored by Killerqu00 Killerqu00 ScarKy0
parent 297276dcc3
commit b9896377ad
15 changed files with 734 additions and 641 deletions
@@ -517,17 +517,39 @@ public sealed partial class ExplosionSystem
else if (tileDef.MapAtmosphere)
canCreateVacuum = true; // is already a vacuum.
var history = CompOrNull<TileHistoryComponent>(tileRef.GridUid);
// break the tile into its underlying parts
int tileBreakages = 0;
while (maxTileBreak > tileBreakages && _robustRandom.Prob(type.TileBreakChance(effectiveIntensity)))
{
tileBreakages++;
effectiveIntensity -= type.TileBreakRerollReduction;
// does this have a base-turf that we can break it down to?
if (string.IsNullOrEmpty(tileDef.BaseTurf))
break;
ContentTileDefinition? newDef = null;
if (_tileDefinitionManager[tileDef.BaseTurf] is not ContentTileDefinition newDef)
// if we have tile history, we revert the tile to its previous state
var chunkIndices = SharedMapSystem.GetChunkIndices(tileRef.GridIndices, TileSystem.ChunkSize);
if (history != null && history.ChunkHistory.TryGetValue(chunkIndices, out var chunk) &&
chunk.History.TryGetValue(tileRef.GridIndices, out var stack) && stack.Count > 0)
{
// last entry in the stack
var newId = stack[^1];
stack.RemoveAt(stack.Count - 1);
if (stack.Count == 0)
chunk.History.Remove(tileRef.GridIndices);
Dirty(tileRef.GridUid, history);
newDef = (ContentTileDefinition) _tileDefinitionManager[newId.Id];
}
else if (tileDef.BaseTurf.HasValue)
{
// otherwise, we just use the base turf
newDef = (ContentTileDefinition) _tileDefinitionManager[tileDef.BaseTurf.Value];
}
if (newDef == null)
break;
if (newDef.MapAtmosphere && !canCreateVacuum)