Power balance tweak
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
package mindustry.world.blocks.power;
|
||||
|
||||
import arc.*;
|
||||
import arc.struct.*;
|
||||
import arc.math.*;
|
||||
import arc.struct.*;
|
||||
import arc.util.*;
|
||||
import mindustry.world.*;
|
||||
import mindustry.world.consumers.*;
|
||||
@@ -199,6 +199,8 @@ public class PowerGraph{
|
||||
lastPowerNeeded = powerNeeded;
|
||||
lastPowerProduced = powerProduced;
|
||||
|
||||
powerBalance.addValue((lastPowerProduced - lastPowerNeeded) / Time.delta());
|
||||
|
||||
if(!(consumers.size == 0 && producers.size == 0 && batteries.size == 0)){
|
||||
|
||||
if(!Mathf.equal(powerNeeded, powerProduced)){
|
||||
@@ -214,8 +216,6 @@ public class PowerGraph{
|
||||
distributePower(powerNeeded, powerProduced);
|
||||
}
|
||||
|
||||
powerBalance.addValue((lastPowerProduced - lastPowerNeeded) / Time.delta());
|
||||
|
||||
//overproducing: 10 / 20 = 0.5
|
||||
//underproducing: 20 / 10 = 2 -> clamp -> 1.0
|
||||
//nothing being produced: 20 / 0 -> 1.0
|
||||
|
||||
Reference in New Issue
Block a user