Fixup buying too many items
This commit is contained in:
1 parent
2b93d72a15
commit
e519d1b00b
2 files changed
+2
-2
No files matched your search
@@ -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;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user