Add CVar for disabling/enabling excited groups.

This commit is contained in:
Vera Aguilera Puerto
2021-07-26 11:06:34 +02:00
parent 7fa10bd17b
commit 86cecd3b5e
4 changed files with 28 additions and 16 deletions

View File

@@ -15,6 +15,7 @@ namespace Content.Server.Atmos.EntitySystems
public bool MonstermosRipTiles { get; private set; }
public bool GridImpulse { get; private set; }
public bool Superconduction { get; private set; }
public bool ExcitedGroups { get; private set; }
public bool ExcitedGroupsSpaceIsAllConsuming { get; private set; }
public float AtmosMaxProcessTime { get; private set; }
public float AtmosTickRate { get; private set; }
@@ -31,6 +32,7 @@ namespace Content.Server.Atmos.EntitySystems
_cfg.OnValueChanged(CCVars.Superconduction, value => Superconduction = value, true);
_cfg.OnValueChanged(CCVars.AtmosMaxProcessTime, value => AtmosMaxProcessTime = value, true);
_cfg.OnValueChanged(CCVars.AtmosTickRate, value => AtmosTickRate = value, true);
_cfg.OnValueChanged(CCVars.ExcitedGroups, value => ExcitedGroups = value, true);
_cfg.OnValueChanged(CCVars.ExcitedGroupsSpaceIsAllConsuming, value => ExcitedGroupsSpaceIsAllConsuming = value, true);
}
}

View File

@@ -38,7 +38,7 @@ namespace Content.Server.Atmos.EntitySystems
var shouldShareAir = false;
if (tile.ExcitedGroup != null && enemyTile.ExcitedGroup != null)
if (ExcitedGroups && tile.ExcitedGroup != null && enemyTile.ExcitedGroup != null)
{
if (tile.ExcitedGroup != enemyTile.ExcitedGroup)
{
@@ -53,21 +53,24 @@ namespace Content.Server.Atmos.EntitySystems
AddActiveTile(gridAtmosphere, enemyTile);
}
var excitedGroup = tile.ExcitedGroup;
excitedGroup ??= enemyTile.ExcitedGroup;
if (excitedGroup == null)
if (ExcitedGroups)
{
excitedGroup = new ExcitedGroup();
gridAtmosphere.ExcitedGroups.Add(excitedGroup);
var excitedGroup = tile.ExcitedGroup;
excitedGroup ??= enemyTile.ExcitedGroup;
if (excitedGroup == null)
{
excitedGroup = new ExcitedGroup();
gridAtmosphere.ExcitedGroups.Add(excitedGroup);
}
if (tile.ExcitedGroup == null)
ExcitedGroupAddTile(excitedGroup, tile);
if(enemyTile.ExcitedGroup == null)
ExcitedGroupAddTile(excitedGroup, enemyTile);
}
if (tile.ExcitedGroup == null)
ExcitedGroupAddTile(excitedGroup, tile);
if(enemyTile.ExcitedGroup == null)
ExcitedGroupAddTile(excitedGroup, enemyTile);
shouldShareAir = true;
}
@@ -102,7 +105,7 @@ namespace Content.Server.Atmos.EntitySystems
if (ConsiderSuperconductivity(gridAtmosphere, tile, true))
remove = false;
if(tile.ExcitedGroup == null && remove)
if(ExcitedGroups && tile.ExcitedGroup == null && remove)
RemoveActiveTile(gridAtmosphere, tile);
}

View File

@@ -281,7 +281,8 @@ namespace Content.Server.Atmos.EntitySystems
}
atmosphere.ProcessingPaused = false;
atmosphere.State = AtmosphereProcessingState.ExcitedGroups;
// Next state depends on whether excited groups are enabled or not.
atmosphere.State = ExcitedGroups ? AtmosphereProcessingState.ExcitedGroups : AtmosphereProcessingState.HighPressureDelta;
continue;
case AtmosphereProcessingState.ExcitedGroups:
if (!ProcessExcitedGroups(atmosphere))