]> git.pond.sub.org Git - empserver/blobdiff - src/lib/commands/buy.c
Fix extension of market bidding time when high bidder changes
[empserver] / src / lib / commands / buy.c
index e7a8ef7057469d425baac69ded89fd8e22e4b735..f3c36151055df31b75511c48d0992e9b174d2794 100644 (file)
@@ -161,16 +161,10 @@ buy(void)
        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 */
        time(&now);
-       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;