Fixes power components (#39)

Fixes the power components not having node set if they get a node added as a component in OnAdd()
This commit is contained in:
clusterfack
2018-03-09 10:59:19 -06:00
committed by Pieter-Jan Briers
parent 7554d51b0a
commit 98bd1552b9
3 changed files with 3 additions and 0 deletions

View File

@@ -40,6 +40,7 @@ namespace Content.Server.GameObjects.Components.Power
if (!Owner.TryGetComponent(out PowerNodeComponent node))
{
Owner.AddComponent<PowerNodeComponent>();
node = Owner.GetComponent<PowerNodeComponent>();
}
node.OnPowernetConnect += PowernetConnect;
node.OnPowernetDisconnect += PowernetDisconnect;