Remove Explicit GridId References (#8315)
Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
using Content.Server.Administration;
|
||||
using Content.Server.Administration;
|
||||
using Content.Server.Atmos.EntitySystems;
|
||||
using Content.Shared.Administration;
|
||||
using Content.Shared.Atmos;
|
||||
@@ -12,22 +12,28 @@ namespace Content.Server.Atmos.Commands
|
||||
{
|
||||
public string Command => "addgas";
|
||||
public string Description => "Adds gas at a certain position.";
|
||||
public string Help => "addgas <X> <Y> <GridId> <Gas> <moles>";
|
||||
public string Help => "addgas <X> <Y> <GridEid> <Gas> <moles>";
|
||||
|
||||
public void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
{
|
||||
if (args.Length < 5) return;
|
||||
|
||||
if(!int.TryParse(args[0], out var x)
|
||||
|| !int.TryParse(args[1], out var y)
|
||||
|| !int.TryParse(args[2], out var id)
|
||||
|| !EntityUid.TryParse(args[2], out var euid)
|
||||
|| !(AtmosCommandUtils.TryParseGasID(args[3], out var gasId))
|
||||
|| !float.TryParse(args[4], out var moles)) return;
|
||||
|
||||
var gridId = new GridId(id);
|
||||
var entMan = IoCManager.Resolve<IEntityManager>();
|
||||
if (!entMan.HasComponent<IMapGridComponent>(euid))
|
||||
{
|
||||
shell.WriteError($"Euid '{euid}' does not exist or is not a grid.");
|
||||
return;
|
||||
}
|
||||
|
||||
var atmosphereSystem = EntitySystem.Get<AtmosphereSystem>();
|
||||
var indices = new Vector2i(x, y);
|
||||
var tile = atmosphereSystem.GetTileMixture(gridId, indices, true);
|
||||
var tile = atmosphereSystem.GetTileMixture(euid, indices, true);
|
||||
|
||||
if (tile == null)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user