ApcNet updating fix (#3078)
* GridPowerComponent * ApcNet Powered update bugfix * PowerTest fix * Add GridPower to Saltern * test fix * Update canceling cleanup * code cleanup * nullable & code cleanup for test * undo power test nullable * Replaces GridPowerSystem with ApcNetSystem * build fix * Update Content.Server/GameObjects/EntitySystems/ApcNetSystem.cs Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
This commit is contained in:
@@ -1,6 +1,4 @@
|
||||
#nullable enable
|
||||
using System.Collections.Generic;
|
||||
using Content.Server.GameObjects.Components.NodeContainer.NodeGroups;
|
||||
using Content.Server.GameObjects.Components.Power.ApcNetComponents;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Shared.GameObjects;
|
||||
@@ -12,17 +10,10 @@ namespace Content.Server.GameObjects.EntitySystems
|
||||
{
|
||||
public override void Update(float frameTime)
|
||||
{
|
||||
var uniqueApcNets = new HashSet<IApcNet>(); //could be improved by maintaining set instead of getting collection every frame
|
||||
foreach (var apc in ComponentManager.EntityQuery<ApcComponent>(false))
|
||||
{
|
||||
uniqueApcNets.Add(apc.Net);
|
||||
apc.Update();
|
||||
}
|
||||
|
||||
foreach (var apcNet in uniqueApcNets)
|
||||
{
|
||||
apcNet.Update(frameTime);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user