Lots stay on the market until there's a bid and bidding time expires.
When the highest bidder changes, and less than five minutes of bidding
time are left, it gets extended by five minutes (since 4.0.7, actually
works since 4.0.9).
Normally, this ensures that the competition has at least five minutes
to react. Except when this is the first bid, bidding time may have
expired already. If it expired less than five minutes ago, the
competition still gets time to react, just less than it should. If it
expired earlier, the sale is executed immediately for units. For
commodities, the bidding time is set to expire in five minutes (since
4.2.0).
Instead of extending bidding time by five minutes, set it to expire in
five minutes, both for commodities and for units.
return RET_FAIL;
if (bid > 0.04 + comm.com_price) {
comm.com_price = bid;
return RET_FAIL;
if (bid > 0.04 + comm.com_price) {
comm.com_price = bid;
- /* Add five minutes to the time if less than 5 minutes */
- if (((MARK_DELAY - (now - comm.com_markettime)) < 300) &&
- comm.com_maxbidder != player->cnum) {
- comm.com_markettime += 300;
- /* Special case - what if so much time has gone by? Well,
- Just reset the markettime so that only 5 minutes are left */
- if ((MARK_DELAY - (now - comm.com_markettime)) < 0)
- comm.com_markettime = (now - (MARK_DELAY - 300));
- }
+ if (comm.com_markettime + MARK_DELAY - now < minutes(5) &&
+ comm.com_maxbidder != player->cnum)
+ comm.com_markettime = now + minutes(5) - MARK_DELAY;
comm.com_maxbidder = player->cnum;
comm.com_x = x;
comm.com_y = y;
comm.com_maxbidder = player->cnum;
comm.com_x = x;
comm.com_y = y;
return RET_OK;
}
if (bid > trade.trd_price) {
return RET_OK;
}
if (bid > trade.trd_price) {
- /* Add five minutes to the time if less than 5 minutes left. */
- if (((TRADE_DELAY - (now - trade.trd_markettime)) < 300) &&
+ if (trade.trd_markettime + TRADE_DELAY - now < minutes(5) &&
trade.trd_maxbidder != player->cnum)
trade.trd_maxbidder != player->cnum)
- trade.trd_markettime += 300;
+ trade.trd_markettime = now + minutes(5) - TRADE_DELAY;
trade.trd_price = bid;
trade.trd_maxbidder = player->cnum;
trade.trd_x = sx;
trade.trd_price = bid;
trade.trd_maxbidder = player->cnum;
trade.trd_x = sx;