Decouple GasPrototype IDs from Gas Enum (#41266)

* Remove final enum coupling from gas YAML

* Fix comment

* Fix test

* Apply suggestions from code review

---------

Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com>
This commit is contained in:
Nemanja
2025-11-21 15:12:13 -05:00
committed by GitHub
parent 5453ad0430
commit 9f94f94cb6
5 changed files with 27 additions and 19 deletions

View File

@@ -13,6 +13,7 @@ namespace Content.Shared.Atmos.EntitySystems
protected bool PvsEnabled;
[Dependency] protected readonly IPrototypeManager ProtoMan = default!;
[Dependency] private readonly SharedAtmosphereSystem _atmosphere = default!;
/// <summary>
/// array of the ids of all visible gases.
@@ -28,7 +29,7 @@ namespace Content.Shared.Atmos.EntitySystems
for (var i = 0; i < Atmospherics.TotalNumberOfGases; i++)
{
var gasPrototype = ProtoMan.Index<GasPrototype>(i.ToString());
var gasPrototype = _atmosphere.GetGas(i);
if (!string.IsNullOrEmpty(gasPrototype.GasOverlayTexture) || !string.IsNullOrEmpty(gasPrototype.GasOverlaySprite) && !string.IsNullOrEmpty(gasPrototype.GasOverlayState))
visibleGases.Add(i);
}