Remove Explicit GridId References (#8315)
Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
This commit is contained in:
@@ -57,26 +57,25 @@ public sealed partial class AtmosphereSystem
|
||||
mixtures[5].AdjustMoles(Gas.Plasma, Atmospherics.MolesCellGasMiner);
|
||||
mixtures[5].Temperature = 5000f;
|
||||
|
||||
var entMan = IoCManager.Resolve<IEntityManager>();
|
||||
|
||||
foreach (var gid in args)
|
||||
{
|
||||
// I like offering detailed error messages, that's why I don't use one of the extension methods.
|
||||
if (!int.TryParse(gid, out var i) || i <= 0)
|
||||
if(EntityUid.TryParse(gid, out var euid))
|
||||
{
|
||||
shell.WriteError($"Invalid grid ID \"{gid}\".");
|
||||
continue;
|
||||
shell.WriteError($"Failed to parse euid '{gid}'.");
|
||||
return;
|
||||
}
|
||||
|
||||
var gridId = new GridId(i);
|
||||
|
||||
if (!_mapManager.TryGetGrid(gridId, out var mapGrid))
|
||||
if (!TryComp(euid, out IMapGridComponent? gridComp))
|
||||
{
|
||||
shell.WriteError($"Grid \"{i}\" doesn't exist.");
|
||||
continue;
|
||||
shell.WriteError($"Euid '{euid}' does not exist or is not a grid.");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!TryComp(mapGrid.GridEntityId, out GridAtmosphereComponent? gridAtmosphere))
|
||||
if (!TryComp(euid, out GridAtmosphereComponent? gridAtmosphere))
|
||||
{
|
||||
shell.WriteError($"Grid \"{i}\" has no atmosphere component, try addatmos.");
|
||||
shell.WriteError($"Grid \"{euid}\" has no atmosphere component, try addatmos.");
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -88,7 +87,7 @@ public sealed partial class AtmosphereSystem
|
||||
|
||||
tile.Clear();
|
||||
var mixtureId = 0;
|
||||
foreach (var entUid in mapGrid.GetAnchoredEntities(indices))
|
||||
foreach (var entUid in gridComp.Grid.GetAnchoredEntities(indices))
|
||||
{
|
||||
if (!TryComp(entUid, out AtmosFixMarkerComponent? afm))
|
||||
continue;
|
||||
|
||||
Reference in New Issue
Block a user