diff --git a/2006Redone Server/src/redone/game/shops/ShopAssistant.java b/2006Redone Server/src/redone/game/shops/ShopAssistant.java index ef1ea0b5..87b2d296 100644 --- a/2006Redone Server/src/redone/game/shops/ShopAssistant.java +++ b/2006Redone Server/src/redone/game/shops/ShopAssistant.java @@ -540,10 +540,10 @@ public class ShopAssistant { int totalValue = value * amount; if (currencyAmount < totalValue) { - amount = (int) Math.floor(player.playerItemsN[currencySlot] / amount); + amount = (int) Math.floor(player.playerItemsN[currencySlot] / value); // buy as many as we can afford totalValue = value * amount; - if (currencyAmount < totalValue) { + if (currencyAmount < totalValue || amount <= 0) { player.getActionSender().sendMessage("You don't have enough " + ItemAssistant.getItemName(currency).toLowerCase() + " to buy that."); return false; } diff --git a/CompiledServer/production/2006rebotted/redone/game/shops/ShopAssistant.class b/CompiledServer/production/2006rebotted/redone/game/shops/ShopAssistant.class index b1ad6174..995dc102 100644 Binary files a/CompiledServer/production/2006rebotted/redone/game/shops/ShopAssistant.class and b/CompiledServer/production/2006rebotted/redone/game/shops/ShopAssistant.class differ