DarkflameUniverse / DarkflameServer

The main repository for the Darkflame Universe Server Emulator project.
https://www.darkflameuniverse.org/
GNU Affero General Public License v3.0
629 stars 171 forks source link

fix: buyback inventory live accuracy #1607

Open TAHuntling opened 1 month ago

TAHuntling commented 1 month ago

Changes made: Modified inventorycomponent.cpp and inventorycomponent.h to include a queue to keep track of item ids when items are being sold to a vendor. This also comes with two new methods, which accomplish this.

What was fixed: Buyback inventory size of27 will be maintained and there will always be an empty slot, at the end reopening the oldest item slot which is the first slot in the inventory, which was not live accurate and prevented players from being able to buy back any further items past the 27 item limit.

Way things were tested: Selling 27+ items, of multiple different types, some with stack sizes. It functions as intended, emptying the oldest slot in the vendor inventory when items are being sold. These changes should not affect other portions of inventories as this will only be applied when the inventory a vendor buyback type.

Thanks for the patience on this one

DarwinAnim8or commented 1 week ago

Any updates on this? Is it ready for review?