Skip to content

Commit

Permalink
fix voidUpgrade insertion code
Browse files Browse the repository at this point in the history
  • Loading branch information
ProjectET committed Aug 15, 2024
1 parent b9f3812 commit 8e7e1ee
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -360,19 +360,19 @@ public long insert(AEKey what, long amount, Actionable mode, IActionSource sourc
}

var currentAmount = this.getCellItems().getLong(what);
long remainingItemCount = getRemainingItemCount();

var toBeInserted = amount;

if (amount > remainingItemCount) {
amount = remainingItemCount;
if (amount > getRemainingItemCount()) {
toBeInserted = getRemainingItemCount();
}

if (mode == Actionable.MODULATE) {
getCellItems().put(what, currentAmount + amount);
getCellItems().put(what, currentAmount + toBeInserted);
this.saveChanges();
}

return amount;
return hasVoidUpgrade ? amount : toBeInserted;
}

@Override
Expand Down

0 comments on commit 8e7e1ee

Please sign in to comment.