(nullify_objects): Use SCT_MAXDEF instead of sct_maxno. Loop no
longer covers the extra empty slots at the end of the dchr[]; doesn't matter. (sct_maxno): Unused, remove.
This commit is contained in:
parent
77a9f94c69
commit
5a725c9177
3 changed files with 2 additions and 5 deletions
|
@ -90,7 +90,7 @@ struct sctstr {
|
||||||
|
|
||||||
struct dchrstr {
|
struct dchrstr {
|
||||||
int d_mnem; /* map symbol */
|
int d_mnem; /* map symbol */
|
||||||
int d_prd; /* product vtype */
|
int d_prd; /* product type */
|
||||||
int d_mcst; /* movement cost */
|
int d_mcst; /* movement cost */
|
||||||
int d_flg; /* movement cost */
|
int d_flg; /* movement cost */
|
||||||
i_packing d_pkg; /* type of packaging in these sects */
|
i_packing d_pkg; /* type of packaging in these sects */
|
||||||
|
@ -162,7 +162,6 @@ struct dchrstr {
|
||||||
/* things relating to sectors */
|
/* things relating to sectors */
|
||||||
extern int sctoff(coord x, coord y);
|
extern int sctoff(coord x, coord y);
|
||||||
|
|
||||||
extern int sct_maxno;
|
|
||||||
extern struct dchrstr dchr[];
|
extern struct dchrstr dchr[];
|
||||||
extern struct dchrstr bigcity_dchr;
|
extern struct dchrstr bigcity_dchr;
|
||||||
|
|
||||||
|
|
|
@ -86,8 +86,6 @@ struct dchrstr dchr[SCT_MAXDEF + 2] = {
|
||||||
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
|
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
|
||||||
};
|
};
|
||||||
|
|
||||||
int sct_maxno = (sizeof(dchr) / sizeof(struct dchrstr)) - 1;
|
|
||||||
|
|
||||||
struct sctintrins intrchr[] = {
|
struct sctintrins intrchr[] = {
|
||||||
/* name lcm hcm dollars mobility */
|
/* name lcm hcm dollars mobility */
|
||||||
{"road network", 2, 2, 2, 1},
|
{"road network", 2, 2, 2, 1},
|
||||||
|
|
|
@ -432,7 +432,7 @@ nullify_objects(void)
|
||||||
if (opt_NO_LCMS)
|
if (opt_NO_LCMS)
|
||||||
nchr[i].n_lcm = 0;
|
nchr[i].n_lcm = 0;
|
||||||
}
|
}
|
||||||
for (i = 0; i < sct_maxno; i++) {
|
for (i = 0; i <= SCT_MAXDEF; i++) {
|
||||||
if (opt_NO_HCMS)
|
if (opt_NO_HCMS)
|
||||||
dchr[i].d_hcms = 0;
|
dchr[i].d_hcms = 0;
|
||||||
if (opt_NO_LCMS)
|
if (opt_NO_LCMS)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue