Content update for NetEntities (#18935)
This commit is contained in:
@@ -10,26 +10,33 @@ namespace Content.Server.Atmos.Commands
|
||||
[AdminCommand(AdminFlags.Debug)]
|
||||
public sealed class FillGas : IConsoleCommand
|
||||
{
|
||||
[Dependency] private readonly IEntityManager _entManager = default!;
|
||||
[Dependency] private readonly IMapManager _mapManager = default!;
|
||||
|
||||
public string Command => "fillgas";
|
||||
public string Description => "Adds gas to all tiles in a grid.";
|
||||
public string Help => "fillgas <GridEid> <Gas> <moles>";
|
||||
|
||||
public void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
{
|
||||
if (args.Length < 3) return;
|
||||
if(!EntityUid.TryParse(args[0], out var gridId)
|
||||
|| !(AtmosCommandUtils.TryParseGasID(args[1], out var gasId))
|
||||
|| !float.TryParse(args[2], out var moles)) return;
|
||||
if (args.Length < 3)
|
||||
return;
|
||||
|
||||
var mapMan = IoCManager.Resolve<IMapManager>();
|
||||
if (!NetEntity.TryParse(args[0], out var gridIdNet)
|
||||
|| !_entManager.TryGetEntity(gridIdNet, out var gridId)
|
||||
|| !(AtmosCommandUtils.TryParseGasID(args[1], out var gasId))
|
||||
|| !float.TryParse(args[2], out var moles))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (!mapMan.TryGetGrid(gridId, out var grid))
|
||||
if (!_mapManager.TryGetGrid(gridId, out var grid))
|
||||
{
|
||||
shell.WriteLine("Invalid grid ID.");
|
||||
return;
|
||||
}
|
||||
|
||||
var atmosphereSystem = EntitySystem.Get<AtmosphereSystem>();
|
||||
var atmosphereSystem = _entManager.System<AtmosphereSystem>();
|
||||
|
||||
foreach (var tile in atmosphereSystem.GetAllMixtures(grid.Owner, true))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user