mirror of
https://git.krews.org/morningstar/Arcturus-Community.git
synced 2025-01-18 23:46:28 +01:00
No more empty gifts!
This commit is contained in:
parent
529a84ec47
commit
f81470f7ba
@ -168,8 +168,13 @@ public class CatalogBuyItemAsGiftEvent extends MessageHandler {
|
||||
item.sellRare();
|
||||
}
|
||||
|
||||
int totalCredits = 0;
|
||||
int totalPoints = 0;
|
||||
int totalCredits = item.getCredits();
|
||||
int totalPoints = item.getPoints();
|
||||
|
||||
if(totalCredits > this.client.getHabbo().getHabboInfo().getCredits() || totalPoints > this.client.getHabbo().getHabboInfo().getCurrencyAmount(item.getPointsType())) {
|
||||
this.client.sendResponse(new AlertPurchaseUnavailableComposer(AlertPurchaseUnavailableComposer.ILLEGAL));
|
||||
return;
|
||||
}
|
||||
|
||||
CatalogLimitedConfiguration limitedConfiguration;
|
||||
int limitedStack = 0;
|
||||
@ -224,23 +229,11 @@ public class CatalogBuyItemAsGiftEvent extends MessageHandler {
|
||||
return;
|
||||
}
|
||||
|
||||
for (int i = 0; i < count; i++) {
|
||||
if (item.getCredits() <= this.client.getHabbo().getHabboInfo().getCredits() - totalCredits) {
|
||||
if (
|
||||
item.getPoints() <= this.client.getHabbo().getHabboInfo().getCurrencyAmount(item.getPointsType()) - totalPoints)
|
||||
//item.getPointsType() == 0 && item.getPoints() <= this.client.getHabbo().getHabboInfo().getPixels() - totalPoints ||
|
||||
|
||||
{
|
||||
if (((i + 1) % 6 != 0 && CatalogItem.haveOffer(item)) || !CatalogItem.haveOffer(item)) {
|
||||
totalCredits += item.getCredits();
|
||||
totalPoints += item.getPoints();
|
||||
}
|
||||
|
||||
for (int j = 0; j < item.getAmount(); j++) {
|
||||
if (item.getAmount() > 1 || item.getBaseItems().size() > 1) {
|
||||
this.client.sendResponse(new AlertPurchaseFailedComposer(AlertPurchaseFailedComposer.SERVER_ERROR).compose());
|
||||
return;
|
||||
}
|
||||
|
||||
for (Item baseItem : item.getBaseItems()) {
|
||||
if (item.getItemAmount(baseItem.getId()) > 1) {
|
||||
this.client.sendResponse(new AlertPurchaseFailedComposer(AlertPurchaseFailedComposer.SERVER_ERROR).compose());
|
||||
@ -320,10 +313,6 @@ public class CatalogBuyItemAsGiftEvent extends MessageHandler {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
StringBuilder giftData = new StringBuilder(itemsList.size() + "\t");
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user