Skip to content

Commit

Permalink
fix: always perform conversion checks
Browse files Browse the repository at this point in the history
  • Loading branch information
thiakil committed Jul 27, 2024
1 parent 22ca133 commit 014b63d
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public int receiveEnergy(int maxReceive, boolean simulate) {
if (toInsert == 0) {
return 0;
}
if (action.execute() && !converter.isOneToOne()) {
if (!converter.isOneToOne()) {
//Before we can actually execute it we need to simulate to calculate how much we can actually insert
long simulatedRemainder = handler.insertEnergy(toInsert, Action.SIMULATE);
if (simulatedRemainder == toInsert) {
Expand Down Expand Up @@ -69,7 +69,7 @@ public int extractEnergy(int maxExtract, boolean simulate) {
if (toExtract == 0) {
return 0;
}
if (action.execute() && !converter.isOneToOne()) {
if (!converter.isOneToOne()) {
//Before we can actually execute it we need to simulate to calculate how much we can actually extract in our other units
long simulatedExtracted = handler.extractEnergy(toExtract, Action.SIMULATE);
//Convert how much we could extract back to FE so that it gets appropriately clamped so that for example 1.5 FE gets treated
Expand Down

0 comments on commit 014b63d

Please sign in to comment.