fix bug where when listing tax is enabled w/confirmation listing, if the player doesn't have enough money to complete listing it dupes the item.

Took 2 minutes
This commit is contained in:
Kiran Hart 2022-12-07 11:57:10 -05:00
parent 416003b410
commit 553a290484
No known key found for this signature in database
GPG Key ID: 5F36C7BC79D3EBC3
3 changed files with 3 additions and 0 deletions

View File

@ -354,6 +354,7 @@ public final class CommandSell extends AbstractCommand {
AuctionCreator.create(auctionPlayer, auctionedItem, (auction, listingResult) -> { AuctionCreator.create(auctionPlayer, auctionedItem, (auction, listingResult) -> {
if (listingResult != ListingResult.SUCCESS) { if (listingResult != ListingResult.SUCCESS) {
player.closeInventory();
PlayerUtils.giveItem(player, auction.getItem()); PlayerUtils.giveItem(player, auction.getItem());
auctionPlayer.setItemBeingListed(null); auctionPlayer.setItemBeingListed(null);
return; return;

View File

@ -335,6 +335,7 @@ public final class GUISellAuction extends AbstractPlaceholderGui {
private void performAuctionListing(GuiClickEvent click) { private void performAuctionListing(GuiClickEvent click) {
AuctionCreator.create(this.auctionPlayer, createListingItem(), (originalListing, listingResult) -> { AuctionCreator.create(this.auctionPlayer, createListingItem(), (originalListing, listingResult) -> {
if (listingResult != ListingResult.SUCCESS) { if (listingResult != ListingResult.SUCCESS) {
click.player.closeInventory();
PlayerUtils.giveItem(click.player, originalListing.getItem()); PlayerUtils.giveItem(click.player, originalListing.getItem());
this.auctionPlayer.setItemBeingListed(null); this.auctionPlayer.setItemBeingListed(null);
return; return;

View File

@ -209,6 +209,7 @@ public final class GUISellBin extends AbstractPlaceholderGui {
private void performAuctionListing(GuiClickEvent click) { private void performAuctionListing(GuiClickEvent click) {
AuctionCreator.create(this.auctionPlayer, createListingItem(), (originalListing, listingResult) -> { AuctionCreator.create(this.auctionPlayer, createListingItem(), (originalListing, listingResult) -> {
if (listingResult != ListingResult.SUCCESS) { if (listingResult != ListingResult.SUCCESS) {
click.player.closeInventory();
PlayerUtils.giveItem(click.player, originalListing.getItem()); PlayerUtils.giveItem(click.player, originalListing.getItem());
this.auctionPlayer.setItemBeingListed(null); this.auctionPlayer.setItemBeingListed(null);
return; return;