Make "build n" accept the optional tech argument
It has currently no real effect on the nuke built (nukes don't improve with tech), but the special case is ugly, and is inconsistent with info build.
This commit is contained in:
parent
61e00d5559
commit
c6137c7ba2
1 changed files with 14 additions and 14 deletions
|
@ -72,7 +72,7 @@ buil(void)
|
||||||
char *p, *what, *prompt;
|
char *p, *what, *prompt;
|
||||||
int gotsect = 0;
|
int gotsect = 0;
|
||||||
int (*build_it)(struct sctstr *, int, short[], int);
|
int (*build_it)(struct sctstr *, int, short[], int);
|
||||||
int number;
|
int number, val;
|
||||||
char buf[1024];
|
char buf[1024];
|
||||||
|
|
||||||
natp = getnatp(player->cnum);
|
natp = getnatp(player->cnum);
|
||||||
|
@ -180,20 +180,20 @@ buil(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (*what != 'n') {
|
|
||||||
if (player->argp[5]) {
|
if (player->argp[5]) {
|
||||||
tlev = atoi(player->argp[5]);
|
val = atoi(player->argp[5]);
|
||||||
if (tlev > natp->nat_level[NAT_TLEV] && !player->god) {
|
if (val > tlev && !player->god) {
|
||||||
pr("Your tech level is only %d.\n",
|
pr("Your%s tech level is only %d.\n",
|
||||||
(int)natp->nat_level[NAT_TLEV]);
|
*what == 'n' && drnuke_const > MIN_DRNUKE_CONST
|
||||||
|
? " effective" : "", tlev);
|
||||||
return RET_FAIL;
|
return RET_FAIL;
|
||||||
}
|
}
|
||||||
if (rqtech > tlev) {
|
if (rqtech > val) {
|
||||||
pr("Required tech is %d.\n", rqtech);
|
pr("Required tech is %d.\n", rqtech);
|
||||||
return RET_FAIL;
|
return RET_FAIL;
|
||||||
}
|
}
|
||||||
pr("building with tech level %d.\n", tlev);
|
tlev = val;
|
||||||
}
|
pr("Building with tech level %d.\n", tlev);
|
||||||
}
|
}
|
||||||
|
|
||||||
while (number-- > 0) {
|
while (number-- > 0) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue