(PRI_SMAINT, PRI_PMAINT, PRI_LMAINT, PRI_SBUILD, PRI_PBUILD,
PRI_LBUILD): Turn macros into enumeration constants. Value SCT_MAXDEF+1 was previously unused; use it. (PRI_MAX): New; replacing the horrible SCT_MAXDEF+8. (show_sect_build): Simply examine all sector types, don't skip the first five. The code ignores them just fine. (show_sect_build, show_sect_stats, show_sect_capab): Don't try to show sector types beyond SCT_MAXDEF. The table has some empty extra slots, for whatever reasons; no use examining them.
This commit is contained in:
parent
cff2deba4a
commit
0ebb14c8be
6 changed files with 30 additions and 27 deletions
|
@ -624,7 +624,7 @@ show_sect_build(int foo)
|
|||
{
|
||||
register int x, first = 1;
|
||||
|
||||
for (x = 5; x < SCT_MAXDEF + 2; x++) {
|
||||
for (x = 0; x <= SCT_MAXDEF; x++) {
|
||||
if (dchr[x].d_mnem == 0)
|
||||
continue;
|
||||
if ((dchr[x].d_cost > 0) || (dchr[x].d_build != 1) ||
|
||||
|
@ -658,7 +658,7 @@ show_sect_stats(int foo)
|
|||
natp = getnatp(player->cnum);
|
||||
/* We fake this */
|
||||
sect.sct_effic = 100;
|
||||
for (x = 0; x < SCT_MAXDEF + 2; x++) {
|
||||
for (x = 0; x <= SCT_MAXDEF; x++) {
|
||||
if (dchr[x].d_mnem == 0)
|
||||
continue;
|
||||
if (first) {
|
||||
|
@ -686,7 +686,7 @@ show_sect_capab(int foo)
|
|||
register int x, first = 1, i, j;
|
||||
char *tmpstr;
|
||||
|
||||
for (x = 0; x < SCT_MAXDEF + 2; x++) {
|
||||
for (x = 0; x <= SCT_MAXDEF; x++) {
|
||||
if ((dchr[x].d_mnem == 0) || (dchr[x].d_prd == 0))
|
||||
continue;
|
||||
if (first) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue