Skip to content

Buying can deduct money without delivering all purchased items #7

Description

@CYooBin10

Labels: critical, bug, economy, data-loss

Description

Money is deducted before the plugin confirms that the player's inventory can accept the complete purchase.

The implementation only checks player.inventory.first_empty, which is insufficient for bulk purchases. One empty slot does not mean the inventory can hold several stacks.

Impact

  • Players can lose money without receiving all items.
  • Bulk purchases may deliver only part of the requested quantity.
  • The success message may report more items than were actually added.

Expected behavior

Before deducting money, calculate whether the inventory can accept the complete quantity.

The plugin must also check the result of add_item(). If item delivery fails after payment, the payment must be refunded.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions