Shock95 / AuctionHouse

Feature-packed auction house plugin for PocketMine-MP (pmmp)
GNU General Public License v3.0
43 stars 34 forks source link

when withdrawing from auction error. #110

Closed Wayder228 closed 2 years ago

Wayder228 commented 2 years ago

Issue description

Write the issue description here

Steps to reproduce the issue

  1. When withdrawing from aha error.
  2. ...

OS and versions

Error/Crash log (If available)

Error: Only arrays and Traversables can be unpacked
File: plugins/AuctionHouse.phar/src/shock95x/auctionhouse/menu/ExpiredMenu
Line: 55
Type: Error

THIS CRASH WAS CAUSED BY A PLUGIN
BAD PLUGIN: AuctionHouse

Code:
[46]    }
[47] 
[48]    public function renderListings(): void {
[49]         foreach($this->getListings() as $index => $listing) {
[50]            $item = clone $listing->getItem();
[51] 
[52]            $expiredItem = Locale::get($this->player, "expired-item");
[53] 
[54]            $lore = str_ireplace(["{PRICE}"], [$listing->getPrice(true, Settings::formatPrice())], preg_filter('/^/', TextFormat::RESET, $expiredItem));
[55]            $lore = Settings::allowLore() ? [...$item->getLore(), ...$lore] : $lore;
[56]            $item->setLore($lore);
[57] 
[58]             $this->getInventory()->setItem($index, $item);
[59]         }
[60]            parent::renderListings();
[61]    }
[62] 
[63]    public function handle(Player $player, Item $itemClicked, Inventory $inventory, int $slot): bool {
[64]        Await::f2c(function () use ($player, $slot, $itemClicked, $inventory) {
[65]            $storage = DataStorage::getInstance();
Shock95 commented 2 years ago

Duplicate of #109

Wayder228 commented 2 years ago

Дубликат # 109

I'm sorry, but it just took a long time to answer.

SiahRBLX commented 2 years ago

When buying from AH or removing i get a black screen