mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-02-25 05:58:14 +07:00
Power balance tweak
This commit is contained in:
parent
b284d6892a
commit
767719d410
@ -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
|
||||
|
@ -1,3 +1,3 @@
|
||||
org.gradle.daemon=true
|
||||
org.gradle.jvmargs=-Xms256m -Xmx1024m
|
||||
archash=04b670f22169ae9e268458950a5d324b5ed03e23
|
||||
archash=9659841bc145ba3db1dff036cfa1ca8f4ebdfabd
|
||||
|
Loading…
Reference in New Issue
Block a user