Fixed mountables not being in a network yet screwing with the racks reconnect logic, closes #1757.

This commit is contained in:
Florian Nücke 2016-04-06 20:20:00 +02:00
parent 9535cad412
commit ce940696cb

View File

@ -105,8 +105,10 @@ class Rack extends traits.PowerAcceptor with traits.Hub with traits.PowerBalance
mapping(0) match {
case Some(side) if toGlobal(side) == plugSide =>
val mountable = getMountable(slot)
if (mountable != null && mountable.node != null && node != mountable.node) {
mountable.node.connect(sidedNode(plugSide))
val busNode = sidedNode(plugSide)
if (busNode != null && mountable != null && mountable.node != null && busNode != mountable.node) {
api.Network.joinNewNetwork(mountable.node)
busNode.connect(mountable.node)
}
case _ => // Not connected to this side.
}