We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4df262e commit f50c52cCopy full SHA for f50c52c
src/toniarts/openkeeper/game/controller/creature/CreatureController.java
@@ -860,8 +860,7 @@ public void addGold(int amount) {
860
Gold gold = entityData.getComponent(entityId, Gold.class);
861
862
// Drop excess gold, we can only carry so much
863
- boolean hasMaxGold = gold.maxGold > 0;
864
- int maxGoldCanAdd = hasMaxGold ? gold.maxGold - gold.gold : Integer.MAX_VALUE;
+ int maxGoldCanAdd = gold.maxGold - gold.gold;
865
int goldToAdd = Math.min(amount, maxGoldCanAdd);
866
int looseGold = amount - goldToAdd;
867
0 commit comments