Skip to content

Commit

Permalink
Partial fix for #5576. Stopped it from overflowing though at some poi…
Browse files Browse the repository at this point in the history
…nt the EnergyNetwork should still be updated to having capacity be a double.
  • Loading branch information
pupnewfster committed Jul 28, 2019
1 parent bebcee0 commit ba41475
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/main/java/mekanism/api/transmitters/DynamicNetwork.java
Expand Up @@ -255,7 +255,9 @@ public int getAcceptorSize() {

public synchronized void updateCapacity() {
updateMeanCapacity();
capacity = (int) meanCapacity * transmitters.size();
double newCapacity = meanCapacity * transmitters.size();
//TODO: Make EnergyNetwork use doubles for capacity rather than just integers
capacity = newCapacity > Integer.MAX_VALUE ? Integer.MAX_VALUE : (int) newCapacity;
}

/**
Expand Down

0 comments on commit ba41475

Please sign in to comment.