Fixed more tests

This commit is contained in:
Anuken
2019-03-10 00:21:21 -05:00
parent 6b074ed4b2
commit 3530ca8989
2 changed files with 7 additions and 5 deletions

View File

@@ -130,9 +130,11 @@ public class PowerGraph{
ConsumePower consumePower = consumes.get(ConsumePower.class);
//currently satisfies power even if it's not required yet
if(consumePower.isBuffered){
// Add an equal percentage of power to all buffers, based on the global power coverage in this graph
float maximumRate = consumePower.requestedPower(consumer.block(), consumer.entity()) * coverage * consumer.entity.delta();
consumer.entity.power.satisfaction = Mathf.clamp(consumer.entity.power.satisfaction + maximumRate / consumePower.powerCapacity);
if(!Mathf.isZero(consumePower.powerCapacity)){
// Add an equal percentage of power to all buffers, based on the global power coverage in this graph
float maximumRate = consumePower.requestedPower(consumer.block(), consumer.entity()) * coverage * consumer.entity.delta();
consumer.entity.power.satisfaction = Mathf.clamp(consumer.entity.power.satisfaction + maximumRate / consumePower.powerCapacity);
}
}else{
consumer.entity.power.satisfaction = coverage;
}