Get rid of RET_SYS, just use RET_FAIL
RET_SYS was used for commands failing due to internal or environmental errors, but not really systematically. The difference to RET_FAIL is how dispatch() treats them: RET_SYS got logged, and cost no BTUs. More specific logging is possible at the point of failure than in dispatch(). Make sure that's done for all failures that used to return RET_SYS. The change in BTU charging affects commands consider, offer, repay, trade failing due to internal errors. It also affects deity commands reload and turn (irrelevant because deities get unlimited BTUs), and commands apropos, info and motd (irrelevant because they cost no BTUs).
This commit is contained in:
parent
e803950463
commit
29aefc356f
10 changed files with 42 additions and 36 deletions
|
@ -142,8 +142,9 @@ do_treaty(void)
|
|||
trty.trt_cnb = recipient;
|
||||
trty.trt_exp = j * SECS_PER_DAY + now;
|
||||
if (!puttre(nstr.cur, &trty)) {
|
||||
logerror("do_treaty: can't write treaty");
|
||||
pr("Couldn't save treaty; get help.\n");
|
||||
return RET_SYS;
|
||||
return RET_FAIL;
|
||||
}
|
||||
wu(0, recipient, "Treaty #%d proposed to you by %s\n",
|
||||
nstr.cur, cname(player->cnum));
|
||||
|
@ -230,8 +231,9 @@ do_loan(void)
|
|||
(void)time(&loan.l_lastpay);
|
||||
loan.l_duedate = loan.l_ldur * SECS_PER_DAY + loan.l_lastpay;
|
||||
if (!putloan(nstr.cur, &loan)) {
|
||||
logerror("do_loan: can't save loan");
|
||||
pr("Couldn't save loan; get help!\n");
|
||||
return RET_SYS;
|
||||
return RET_FAIL;
|
||||
}
|
||||
pr("You have offered loan %d\n", nstr.cur);
|
||||
wu(0, recipient, "Country #%d has offered you a loan (#%d)\n",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue