Skip to content

Commit f50c52c

Browse files
committed
Creatures always have max gold set
1 parent 4df262e commit f50c52c

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/toniarts/openkeeper/game/controller/creature/CreatureController.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -860,8 +860,7 @@ public void addGold(int amount) {
860860
Gold gold = entityData.getComponent(entityId, Gold.class);
861861

862862
// 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;
863+
int maxGoldCanAdd = gold.maxGold - gold.gold;
865864
int goldToAdd = Math.min(amount, maxGoldCanAdd);
866865
int looseGold = amount - goldToAdd;
867866

0 commit comments

Comments
 (0)