Partial atmos refactor (#22521)
* Reduce atmos component queries * Remove method events * Cache airtight data * Make MolesArchived nullable * Fix airtight cache * only get tile def once * Immutable mixtures * firelock queries * misc * misc cleanup * Trim disconnected tiles * Fix merge issues and bugs * Why does the PR keep increasing in scope * debug overlay * Fix bugs * Fix test, remove unused events * Add setmapatmos command * Fix overlays * Add map check * A * Resolve conflicts with #26102 * Remove some obsolete methods
This commit is contained in:
@@ -72,7 +72,8 @@ namespace Content.Server.Atmos.EntitySystems
|
||||
|
||||
var tileSize = excitedGroup.Tiles.Count;
|
||||
|
||||
if (excitedGroup.Disposed) return;
|
||||
if (excitedGroup.Disposed)
|
||||
return;
|
||||
|
||||
if (tileSize == 0)
|
||||
{
|
||||
@@ -98,7 +99,9 @@ namespace Content.Server.Atmos.EntitySystems
|
||||
|
||||
foreach (var tile in excitedGroup.Tiles)
|
||||
{
|
||||
if (tile?.Air == null) continue;
|
||||
if (tile?.Air == null)
|
||||
continue;
|
||||
|
||||
tile.Air.CopyFromMutable(combined);
|
||||
InvalidateVisuals(tile.GridIndex, tile.GridIndices);
|
||||
}
|
||||
@@ -106,21 +109,23 @@ namespace Content.Server.Atmos.EntitySystems
|
||||
excitedGroup.BreakdownCooldown = 0;
|
||||
}
|
||||
|
||||
private void ExcitedGroupDismantle(GridAtmosphereComponent gridAtmosphere, ExcitedGroup excitedGroup, bool unexcite = true)
|
||||
/// <summary>
|
||||
/// This de-activates and removes all tiles in an excited group.
|
||||
/// </summary>
|
||||
private void DeactivateGroupTiles(GridAtmosphereComponent gridAtmosphere, ExcitedGroup excitedGroup)
|
||||
{
|
||||
foreach (var tile in excitedGroup.Tiles)
|
||||
{
|
||||
tile.ExcitedGroup = null;
|
||||
|
||||
if (!unexcite)
|
||||
continue;
|
||||
|
||||
RemoveActiveTile(gridAtmosphere, tile);
|
||||
}
|
||||
|
||||
excitedGroup.Tiles.Clear();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This removes an excited group without de-activating its tiles.
|
||||
/// </summary>
|
||||
private void ExcitedGroupDispose(GridAtmosphereComponent gridAtmosphere, ExcitedGroup excitedGroup)
|
||||
{
|
||||
if (excitedGroup.Disposed)
|
||||
@@ -129,9 +134,14 @@ namespace Content.Server.Atmos.EntitySystems
|
||||
DebugTools.Assert(gridAtmosphere.ExcitedGroups.Contains(excitedGroup), "Grid Atmosphere does not contain Excited Group!");
|
||||
|
||||
excitedGroup.Disposed = true;
|
||||
|
||||
gridAtmosphere.ExcitedGroups.Remove(excitedGroup);
|
||||
ExcitedGroupDismantle(gridAtmosphere, excitedGroup, false);
|
||||
|
||||
foreach (var tile in excitedGroup.Tiles)
|
||||
{
|
||||
tile.ExcitedGroup = null;
|
||||
}
|
||||
|
||||
excitedGroup.Tiles.Clear();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user