mirror of
https://github.com/MightyPirates/OpenComputers.git
synced 2025-09-16 10:51:55 -04:00
Fixed newly placed cases having zero energy buffer capacity.
This commit is contained in:
parent
e1e4c3b5e9
commit
ccee1eeb94
@ -105,7 +105,14 @@ trait Environment extends TileEntity with network.Environment with network.Envir
|
||||
|
||||
override def onDisconnect(node: network.Node) {
|
||||
if (node == this.node) node match {
|
||||
case connector: Connector => connector.setLocalBufferSize(0)
|
||||
case connector: Connector =>
|
||||
// Set it to zero to push all energy into other nodes, to
|
||||
// avoid energy loss when removing nodes. Set it back to the
|
||||
// original value though, as there are cases where the node
|
||||
// is re-used afterwards, without re-adjusting its buffer size.
|
||||
var bufferSize = connector.localBufferSize()
|
||||
connector.setLocalBufferSize(0)
|
||||
connector.setLocalBufferSize(bufferSize)
|
||||
case _ =>
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user