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

@@ -100,7 +100,7 @@ internal sealed class PowerMonitoringConsoleSystem : EntitySystem
// Actually set state.
if (_userInterfaceSystem.TryGetUi(target, PowerMonitoringConsoleUiKey.Key, out var bui))
UserInterfaceSystem.SetUiState(bui, new PowerMonitoringConsoleBoundInterfaceState(totalSources, totalLoads, sources.ToArray(), loads.ToArray()));
_userInterfaceSystem.SetUiState(bui, new PowerMonitoringConsoleBoundInterfaceState(totalSources, totalLoads, sources.ToArray(), loads.ToArray()));
}
private int CompareLoadOrSources(PowerMonitoringConsoleEntry x, PowerMonitoringConsoleEntry y)

View File

@@ -72,7 +72,7 @@ public sealed class PortableGeneratorSystem : SharedPortableGeneratorSystem
if (fuelGenerator.On || !Transform(uid).Anchored)
return;
_doAfter.TryStartDoAfter(new DoAfterArgs(user, component.StartTime, new GeneratorStartedEvent(), uid, uid)
_doAfter.TryStartDoAfter(new DoAfterArgs(EntityManager, user, component.StartTime, new GeneratorStartedEvent(), uid, uid)
{
BreakOnDamage = true, BreakOnTargetMove = true, BreakOnUserMove = true, RequireCanInteract = true,
NeedHand = true

View File

@@ -8,6 +8,8 @@ namespace Content.Server.Power
[AdminCommand(AdminFlags.Debug)]
public sealed class SetBatteryPercentCommand : IConsoleCommand
{
[Dependency] private readonly IEntityManager _entManager = default!;
public string Command => "setbatterypercent";
public string Description => "Drains or recharges a battery by entity uid and percentage, i.e.: forall with Battery do setbatterypercent $ID 0";
public string Help => $"{Command} <id> <percent>";
@@ -20,7 +22,7 @@ namespace Content.Server.Power
return;
}
if (!EntityUid.TryParse(args[0], out var id))
if (!NetEntity.TryParse(args[0], out var netEnt) || !_entManager.TryGetEntity(netEnt, out var id))
{
shell.WriteLine($"{args[0]} is not a valid entity id.");
return;
@@ -32,9 +34,7 @@ namespace Content.Server.Power
return;
}
var entityManager = IoCManager.Resolve<IEntityManager>();
if (!entityManager.TryGetComponent<BatteryComponent>(id, out var battery))
if (!_entManager.TryGetComponent<BatteryComponent>(id, out var battery))
{
shell.WriteLine($"No battery found with id {id}.");
return;