From 6b0a70d3d166c15be3bd9a039f34270ebf885303 Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Sat, 23 Apr 2011 11:11:23 +0200 Subject: [PATCH] Better diagnostics when build can't find suitable sectors Report "No sectors" when there are no *owned* sectors, instead of "Bad sector specification" when there are no sectors at all. --- src/lib/commands/buil.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/lib/commands/buil.c b/src/lib/commands/buil.c index 3db8f913f..a77548ef6 100644 --- a/src/lib/commands/buil.c +++ b/src/lib/commands/buil.c @@ -193,17 +193,16 @@ buil(void) gotsect = 0; while (number-- > 0) { while (nxtsct(&nstr, §)) { - gotsect++; if (!player->owner) continue; + gotsect = 1; if (build_it(§, type, sect.sct_item, tlev)) putsect(§); } snxtsct_rewind(&nstr); } - if (!gotsect) { - pr("Bad sector specification.\n"); - } + if (!gotsect) + pr("No sectors.\n"); return RET_OK; } @@ -619,15 +618,14 @@ build_bridge(char what) return RET_SYN; gotsect = 0; while (nxtsct(&nstr, §)) { - gotsect++; if (!player->owner) continue; + gotsect = 1; if (build_it(§, sect.sct_item)) putsect(§); } - if (!gotsect) { - pr("Bad sector specification.\n"); - } + if (!gotsect) + pr("No sectors.\n"); return RET_OK; } -- 2.43.0