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

@@ -24,29 +24,27 @@ namespace Content.Server.Atmos.Commands
return;
}
var entMan = IoCManager.Resolve<IEntityManager>();
if (!EntityUid.TryParse(args[0], out var euid))
if (!NetEntity.TryParse(args[0], out var eNet) || !_entities.TryGetEntity(eNet, out var euid))
{
shell.WriteError($"Failed to parse euid '{args[0]}'.");
return;
}
if (!entMan.HasComponent<MapGridComponent>(euid))
if (!_entities.HasComponent<MapGridComponent>(euid))
{
shell.WriteError($"Euid '{euid}' does not exist or is not a grid.");
return;
}
var atmos = entMan.EntitySysManager.GetEntitySystem<AtmosphereSystem>();
var atmos = _entities.EntitySysManager.GetEntitySystem<AtmosphereSystem>();
if (atmos.HasAtmosphere(euid))
if (atmos.HasAtmosphere(euid.Value))
{
shell.WriteLine("Grid already has an atmosphere.");
return;
}
_entities.AddComponent<GridAtmosphereComponent>(euid);
_entities.AddComponent<GridAtmosphereComponent>(euid.Value);
shell.WriteLine($"Added atmosphere to grid {euid}.");
}