]> git.pond.sub.org Git - empserver/commitdiff
Make capital fail more nicely when sector is unsuitable
authorMarkus Armbruster <armbru@pond.sub.org>
Tue, 8 Jan 2013 13:41:30 +0000 (14:41 +0100)
committerMarkus Armbruster <armbru@pond.sub.org>
Sat, 12 Jan 2013 16:56:26 +0000 (17:56 +0100)
The command fails without an explanation then.  Change it to print
something like "X,Y is not a capital or mountain owned by you."

src/lib/commands/capi.c

index 9f9c5828f0cad90de6928d9f3b576ec3a13bf2f6..b8d788aaa615ce28a207116cc48aefc0cfc609bd 100644 (file)
@@ -50,6 +50,9 @@ capi(void)
        return RET_SYN;
     if (!player->owner
        || (sect.sct_type != SCT_CAPIT && sect.sct_type != SCT_MOUNT)) {
+       pr("%s is not a %s or %s owned by you.\n",
+          xyas(sect.sct_x, sect.sct_y, player->cnum),
+          dchr[SCT_CAPIT].d_name, dchr[SCT_MOUNT].d_name);
        return RET_FAIL;
     }
     np = getnatp(player->cnum);