]> git.pond.sub.org Git - empserver/blobdiff - src/lib/commands/buy.c
buy: Don't continue when lot changes while asking for bid
[empserver] / src / lib / commands / buy.c
index 3b24033e2ca91c1bf0569ca850ebf3743b9a4edd..83b85d56d9a337ae750d97beb09be56edd6e749d 100644 (file)
@@ -101,6 +101,8 @@ buy(void)
     bid = atof(p);
     if (bid <= 0)
        return RET_FAIL;
+    if (!check_comm_ok(&comm))
+       return RET_FAIL;
     if (natp->nat_money < bid * comm.com_amount * buytax) {
        pr("This purchase would cost %.2f, %.2f more than you have.\n",
           bid * comm.com_amount * buytax,
@@ -126,7 +128,6 @@ buy(void)
        }
     }
     canspend = natp->nat_money - tally;
-    check_comm_ok(&comm);
     if (bid * comm.com_amount * buytax > canspend) {
        pr("You have overextended yourself in the market\n");
        pr("You can not bid on the current items at that price.\n");