diff --git a/include/land.h b/include/land.h index 6bb8da41..62533403 100644 --- a/include/land.h +++ b/include/land.h @@ -182,7 +182,6 @@ struct lchrstr { (struct lndstr *) ef_ptr(EF_LAND, n) extern struct lchrstr lchr[N_MAXLAND + 1]; -extern int lnd_maxno; struct llist { struct emp_qelem queue; /* list of units */ diff --git a/src/lib/global/land.c b/src/lib/global/land.c index 8ed37ab6..0b855d43 100644 --- a/src/lib/global/land.c +++ b/src/lib/global/land.c @@ -207,11 +207,9 @@ struct lchrstr lchr[] = { */ {{0}, - "", + NULL, 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 lnd_maxno = (sizeof(lchr) / sizeof(struct lchrstr)) - 1; diff --git a/src/lib/subs/show.c b/src/lib/subs/show.c index 77559666..10a90553 100644 --- a/src/lib/subs/show.c +++ b/src/lib/subs/show.c @@ -117,11 +117,9 @@ make_new_list(int tlev, int type) lookup_list_cnt++; } } else if (type == EF_LAND) { - for (lp = lchr, count = 0; count < lnd_maxno; count++, lp++) { + for (lp = lchr; lp->l_name; lp++) { if (lp->l_tech > tlev) continue; - if (lp->l_name == 0 || lp->l_name[0] == '\0') - continue; lookup_list[lookup_list_cnt].l_u.lp = lp; lookup_list[lookup_list_cnt].tech = lp->l_tech; lookup_list_cnt++; diff --git a/src/server/main.c b/src/server/main.c index 7e040f1f..9f6258d2 100644 --- a/src/server/main.c +++ b/src/server/main.c @@ -503,7 +503,7 @@ nullify_objects(void) if (opt_NO_OIL) plchr[i].pl_fuel = 0; } - for (i = 0; i < lnd_maxno; i++) { + for (i = 0; i < lchr[i].l_name; i++) { if (opt_NO_HCMS) lchr[i].l_hcm = 0; if (opt_NO_LCMS)