buy: Fix bogus error when lot gets reused at the last prompt
When the lot being bid for goes away and gets reused while the player is at the prompt for the destination sector, comm.com_amount gets stale. We use it before we detect the change and fail the command This can lead to a misleading ""You don't have that much to spend!" error. Messed up when the code was fixed to deal with lot changes in 4.0.2. Fix by checking for lot change earlier. Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
This commit is contained in:
parent
1b677a4578
commit
a021a20e55
1 changed files with 2 additions and 2 deletions
|
@ -141,6 +141,8 @@ buy(void)
|
||||||
pr("Could not access sector");
|
pr("Could not access sector");
|
||||||
return RET_FAIL;
|
return RET_FAIL;
|
||||||
}
|
}
|
||||||
|
if (!check_comm_ok(&comm))
|
||||||
|
return RET_FAIL;
|
||||||
if ((sect.sct_type != SCT_WAREH && sect.sct_type != SCT_HARBR) ||
|
if ((sect.sct_type != SCT_WAREH && sect.sct_type != SCT_HARBR) ||
|
||||||
sect.sct_own != player->cnum) {
|
sect.sct_own != player->cnum) {
|
||||||
pr("The destination sector is not one of your warehouses.\n");
|
pr("The destination sector is not one of your warehouses.\n");
|
||||||
|
@ -161,8 +163,6 @@ buy(void)
|
||||||
pr("You don't have that much to spend!\n");
|
pr("You don't have that much to spend!\n");
|
||||||
return RET_FAIL;
|
return RET_FAIL;
|
||||||
}
|
}
|
||||||
if (!check_comm_ok(&comm))
|
|
||||||
return RET_FAIL;
|
|
||||||
if (bid > 0.04 + comm.com_price) {
|
if (bid > 0.04 + comm.com_price) {
|
||||||
comm.com_price = bid;
|
comm.com_price = bid;
|
||||||
time(&now);
|
time(&now);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue