Fixed power balance display being influenced by delta
This commit is contained in:
@@ -7,6 +7,7 @@ import io.anuke.arc.collection.ObjectSet;
|
|||||||
import io.anuke.arc.collection.Queue;
|
import io.anuke.arc.collection.Queue;
|
||||||
import io.anuke.arc.math.Mathf;
|
import io.anuke.arc.math.Mathf;
|
||||||
import io.anuke.arc.math.WindowedMean;
|
import io.anuke.arc.math.WindowedMean;
|
||||||
|
import io.anuke.arc.util.Time;
|
||||||
import io.anuke.mindustry.world.Tile;
|
import io.anuke.mindustry.world.Tile;
|
||||||
import io.anuke.mindustry.world.consumers.Consume;
|
import io.anuke.mindustry.world.consumers.Consume;
|
||||||
import io.anuke.mindustry.world.consumers.ConsumePower;
|
import io.anuke.mindustry.world.consumers.ConsumePower;
|
||||||
@@ -131,7 +132,6 @@ public class PowerGraph{
|
|||||||
//if(!otherConsumersAreValid(consumer, consumePower)){
|
//if(!otherConsumersAreValid(consumer, consumePower)){
|
||||||
// consumer.entity.power.satisfaction = 0.0f; // Only supply power if the consumer would get valid that way
|
// consumer.entity.power.satisfaction = 0.0f; // Only supply power if the consumer would get valid that way
|
||||||
//}else{
|
//}else{
|
||||||
|
|
||||||
//currently satisfies power even if it's not required yet
|
//currently satisfies power even if it's not required yet
|
||||||
if(consumePower.isBuffered){
|
if(consumePower.isBuffered){
|
||||||
// Add an equal percentage of power to all buffers, based on the global power coverage in this graph
|
// Add an equal percentage of power to all buffers, based on the global power coverage in this graph
|
||||||
@@ -163,7 +163,7 @@ public class PowerGraph{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
powerBalance.addValue(powerProduced - powerNeeded);
|
powerBalance.addValue((powerProduced - powerNeeded) / Time.delta());
|
||||||
|
|
||||||
distributePower(powerNeeded, powerProduced);
|
distributePower(powerNeeded, powerProduced);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ public class Consumers{
|
|||||||
* @param powerCapacity The maximum capacity in power units.
|
* @param powerCapacity The maximum capacity in power units.
|
||||||
*/
|
*/
|
||||||
public ConsumePower powerBuffered(float powerCapacity){
|
public ConsumePower powerBuffered(float powerCapacity){
|
||||||
return powerBuffered(powerCapacity, 1f);
|
return powerBuffered(powerCapacity, 60f * 3);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user