Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: correct fee validation logic in market offer creation #3250

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

feliphechaves
Copy link

Description

This PR fixes an issue with the market offer creation process where the player was incorrectly prevented from posting items for sale due to a faulty calculation of the required funds. The validation now ensures the player has enough money to pay only the market fee, rather than the total price of the items plus the fee.

Behaviour

Actual

When attempting to create a market sell offer, the player is blocked if their total money (hand + bank balance) is less than the total price of the items plus the fee.

Do this and that doesn't happens

Expected

The player should only need enough money to cover the fee for creating the market offer.

Fixes #issuenumber

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested

  1. Create a sell offer for an item where the total item price is greater than the player's total money but the fee is affordable.
  2. Verify that the player is allowed to post the item and only the fee is deducted.

Test Scenarios:
Posting an item where the player has enough money for the fee only.
Attempting to post an item without sufficient funds for the fee.

Test Configuration:

  • Server Version: Latest
  • Client: 13.4
  • Operating System: Linux/Windows

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I checked the PR checks reports
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants