Content update for NetEntities (#18935)

This commit is contained in:
metalgearsloth
2023-09-11 09:42:41 +10:00
committed by GitHub
parent 389c8d1a2c
commit 5a0fc68be2
526 changed files with 3058 additions and 2215 deletions

View File

@@ -10,17 +10,23 @@ namespace Content.Server.Atmos.Commands
[AdminCommand(AdminFlags.Debug)]
public sealed class SetAtmosTemperatureCommand : IConsoleCommand
{
[Dependency] private readonly IEntityManager _entManager = default!;
[Dependency] private readonly IMapManager _mapManager = default!;
public string Command => "setatmostemp";
public string Description => "Sets a grid's temperature (in kelvin).";
public string Help => "Usage: setatmostemp <GridId> <Temperature>";
public void Execute(IConsoleShell shell, string argStr, string[] args)
{
if (args.Length < 2) return;
if(!EntityUid.TryParse(args[0], out var gridId)
|| !float.TryParse(args[1], out var temperature)) return;
if (args.Length < 2)
return;
var mapMan = IoCManager.Resolve<IMapManager>();
if (!_entManager.TryParseNetEntity(args[0], out var gridId)
|| !float.TryParse(args[1], out var temperature))
{
return;
}
if (temperature < Atmospherics.TCMB)
{
@@ -28,13 +34,13 @@ namespace Content.Server.Atmos.Commands
return;
}
if (!gridId.IsValid() || !mapMan.TryGetGrid(gridId, out var gridComp))
if (!gridId.Value.IsValid() || !_mapManager.TryGetGrid(gridId, out var gridComp))
{
shell.WriteLine("Invalid grid ID.");
return;
}
var atmosphereSystem = EntitySystem.Get<AtmosphereSystem>();
var atmosphereSystem = _entManager.System<AtmosphereSystem>();
var tiles = 0;
foreach (var tile in atmosphereSystem.GetAllMixtures(gridComp.Owner, true))