From 6ec936a8d6e3975f45edd8ce53d6ad9ebf02e3b5 Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Sat, 11 Jun 2016 16:45:39 +0200 Subject: [PATCH] collect: Don't permit confiscation of active capital The whole idea of a sector acquiescing to takeover by lawyers waving loan documents "proving" it's rightfully theirs is pretty preposterous. But a capital giving itself up that way (and then paying out half the nation's treasury on top) beggars belief. Disallow it. Signed-off-by: Markus Armbruster --- info/collect.t | 2 -- src/lib/commands/coll.c | 12 ++++++++---- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/info/collect.t b/info/collect.t index b5889bbfa..494f90d29 100644 --- a/info/collect.t +++ b/info/collect.t @@ -8,8 +8,6 @@ Through the collect command overdue loans can be \*Qcleared up\*U. If you should find that you have a problem debtor who refuses to pay up on your kind loan you can always seize one or more of his/her sectors. -Perhaps the mere threat of a collection on -someone's capital may do the trick! .s1 To settle up accounts on overdue loan #9 you would type: .EX collect 9 diff --git a/src/lib/commands/coll.c b/src/lib/commands/coll.c index 4b6a0b28b..1afc7d979 100644 --- a/src/lib/commands/coll.c +++ b/src/lib/commands/coll.c @@ -50,6 +50,7 @@ coll(void) char *p; struct lonstr loan; struct sctstr sect; + struct natstr *lonee_np; coord x, y; double owed; double pay; @@ -76,6 +77,7 @@ coll(void) return RET_FAIL; } + lonee_np = getnatp(loan.l_lonee); pr("You are owed $%.2f on that loan.\n", owed); p = getstarg(player->argp[2], "What sector do you wish to confiscate? ", buf); @@ -106,6 +108,12 @@ coll(void) owed); return RET_FAIL; } + if (!influx(lonee_np) + && sect.sct_x == lonee_np->nat_xcap + && sect.sct_y == lonee_np->nat_ycap) { + pr("%s's capital cannot be confiscated.\n", cname(loan.l_lonee)); + return RET_FAIL; + } pr("That sector (and its contents) is valued at $%.2f\n", pay); sect.sct_item[I_MILIT] = 1; /* FIXME now where did this guy come from? */ @@ -115,15 +123,11 @@ coll(void) * unwanted things, like generate che. */ sect.sct_own = player->cnum; - memset(sect.sct_dist, 0, sizeof(sect.sct_dist)); memset(sect.sct_del, 0, sizeof(sect.sct_del)); sect.sct_off = 1; sect.sct_dist_x = sect.sct_x; sect.sct_dist_y = sect.sct_y; - - if (sect.sct_type == SCT_CAPIT || sect.sct_type == SCT_MOUNT) - caploss(§, loan.l_lonee, "that was %s's capital!\n"); putsect(§); nreport(player->cnum, N_SEIZE_SECT, loan.l_lonee, 1); owed = loan_owed(&loan, time(&now)); -- 2.43.0