Skip to content

Commit 93db96c

Browse files
fix: correct fee validation logic in market offer creation (#3250)
This 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.
1 parent 8e1fd02 commit 93db96c

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

src/game/game.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9069,8 +9069,7 @@ void Game::playerCreateMarketOffer(uint32_t playerId, uint8_t type, uint16_t ite
90699069
uint64_t fee = std::clamp(totalFee, uint64_t(20), maxFee); // Limit between 20 and maxFee
90709070

90719071
if (type == MARKETACTION_SELL) {
9072-
uint64_t totalPriceWithFee = totalPrice + fee;
9073-
if (totalPriceWithFee > (player->getMoney() + player->getBankBalance())) {
9072+
if (fee > (player->getMoney() + player->getBankBalance())) {
90749073
offerStatus << "Fee is greater than player money";
90759074
return;
90769075
}

0 commit comments

Comments
 (0)