Clean up buil()'s variable declarations

This commit is contained in:
Markus Armbruster 2011-04-23 10:51:35 +02:00
parent c6137c7ba2
commit 5fb330cfdd

View file

@ -63,21 +63,15 @@ static int build_can_afford(double, char *);
int int
buil(void) buil(void)
{ {
struct natstr *natp = getnatp(player->cnum);
int tlev = (int)natp->nat_level[NAT_TLEV];
struct sctstr sect; struct sctstr sect;
struct nstr_sect nstr; struct nstr_sect nstr;
struct natstr *natp; int rqtech, type, number, val, gotsect;
int rqtech;
int tlev;
int type;
char *p, *what, *prompt; char *p, *what, *prompt;
int gotsect = 0;
int (*build_it)(struct sctstr *, int, short[], int); int (*build_it)(struct sctstr *, int, short[], int);
int number, val;
char buf[1024]; char buf[1024];
natp = getnatp(player->cnum);
tlev = (int)natp->nat_level[NAT_TLEV];
p = getstarg(player->argp[1], p = getstarg(player->argp[1],
"Build (ship, nuke, bridge, plane, land unit, tower)? ", "Build (ship, nuke, bridge, plane, land unit, tower)? ",
buf); buf);
@ -196,6 +190,7 @@ buil(void)
pr("Building with tech level %d.\n", tlev); pr("Building with tech level %d.\n", tlev);
} }
gotsect = 0;
while (number-- > 0) { while (number-- > 0) {
while (nxtsct(&nstr, &sect)) { while (nxtsct(&nstr, &sect)) {
gotsect++; gotsect++;