]> git.pond.sub.org Git - empserver/commitdiff
(coll): Fix freeing of repaid loan. The incorrectly freed loan
authorMarkus Armbruster <armbru@pond.sub.org>
Sat, 20 Jan 2007 15:57:25 +0000 (15:57 +0000)
committerMarkus Armbruster <armbru@pond.sub.org>
Sat, 20 Jan 2007 15:57:25 +0000 (15:57 +0000)
continued to exist.  Fortunately, both shark and collect refused to
touch it.  fina() and repa() oopsed in loan_owed(), and recovered by
assuming (incorrectly!) a plausible debt.  Before trdsub.c rev. 1.7,
fina() catched and logged the bug, and ignored the loan, and repa()
computed a ridiculous debt.

src/lib/commands/coll.c

index 495fbb1995f1f554c0c19a1b045d952e9e921d90..535f8da9d127733221613336b9d654bed6e9ceaa 100644 (file)
@@ -127,6 +127,7 @@ coll(void)
     nreport(player->cnum, N_SEIZE_SECT, loan.l_lonee, 1);
     owed = loan_owed(&loan, time(&now));
     if (pay >= owed) {
+       loan.l_status = LS_FREE;
        loan.l_ldur = 0;
        nreport(loan.l_lonee, N_REPAY_LOAN, player->cnum, 1);
        wu(0, loan.l_lonee,