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.
This commit is contained in:
parent
5fb330cfdd
commit
6b0a70d3d1
1 changed files with 6 additions and 8 deletions
|
@ -193,17 +193,16 @@ buil(void)
|
||||||
gotsect = 0;
|
gotsect = 0;
|
||||||
while (number-- > 0) {
|
while (number-- > 0) {
|
||||||
while (nxtsct(&nstr, §)) {
|
while (nxtsct(&nstr, §)) {
|
||||||
gotsect++;
|
|
||||||
if (!player->owner)
|
if (!player->owner)
|
||||||
continue;
|
continue;
|
||||||
|
gotsect = 1;
|
||||||
if (build_it(§, type, sect.sct_item, tlev))
|
if (build_it(§, type, sect.sct_item, tlev))
|
||||||
putsect(§);
|
putsect(§);
|
||||||
}
|
}
|
||||||
snxtsct_rewind(&nstr);
|
snxtsct_rewind(&nstr);
|
||||||
}
|
}
|
||||||
if (!gotsect) {
|
if (!gotsect)
|
||||||
pr("Bad sector specification.\n");
|
pr("No sectors.\n");
|
||||||
}
|
|
||||||
return RET_OK;
|
return RET_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -619,15 +618,14 @@ build_bridge(char what)
|
||||||
return RET_SYN;
|
return RET_SYN;
|
||||||
gotsect = 0;
|
gotsect = 0;
|
||||||
while (nxtsct(&nstr, §)) {
|
while (nxtsct(&nstr, §)) {
|
||||||
gotsect++;
|
|
||||||
if (!player->owner)
|
if (!player->owner)
|
||||||
continue;
|
continue;
|
||||||
|
gotsect = 1;
|
||||||
if (build_it(§, sect.sct_item))
|
if (build_it(§, sect.sct_item))
|
||||||
putsect(§);
|
putsect(§);
|
||||||
}
|
}
|
||||||
if (!gotsect) {
|
if (!gotsect)
|
||||||
pr("Bad sector specification.\n");
|
pr("No sectors.\n");
|
||||||
}
|
|
||||||
return RET_OK;
|
return RET_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue