Fix not accounting initial cable node limit when transfering energy

This commit is contained in:
DBotThePony 2023-12-31 10:53:55 +07:00
parent 6be24540a5
commit be52bbdc59
Signed by: DBot
GPG Key ID: DCC23B5715498507

View File

@ -89,7 +89,7 @@ class EnergyCableGraph : GraphNodeList<EnergyCableBlockEntity.Node, EnergyCableG
fun receiveEnergy(howMuch: Decimal, simulate: Boolean, fromNode: EnergyCableBlockEntity.Node, fromSide: RelativeSide): Decimal { fun receiveEnergy(howMuch: Decimal, simulate: Boolean, fromNode: EnergyCableBlockEntity.Node, fromSide: RelativeSide): Decimal {
val itr = livelyNodes.iterator() val itr = livelyNodes.iterator()
var received = Decimal.ZERO var received = Decimal.ZERO
var residue = howMuch var residue = howMuch.coerceAtMost(fromNode.energyThroughput)
for (node in itr) { for (node in itr) {
var hit = false var hit = false