loljoshie / lj-inventory

GNU General Public License v3.0
91 stars 179 forks source link

(fix) not deleting items if first slot is lower #150

Closed david-almagro closed 1 year ago

david-almagro commented 1 year ago

Found this bug in my server, where, in case you had 1 slot with an amount under the total amount to remove, (for example, 1 in slot1 and 4 in slot 4, try to remove 5), it would return true but not remove anything. This fixes it by removing the first slot and continuing without updating the inventory. This way, if the total amount in all slots is under the amount to remove, it would not finish removing and simply return false.

Pull Request Checklist: