diff --git a/include/plane.h b/include/plane.h index bb32aac2..2428f7dd 100644 --- a/include/plane.h +++ b/include/plane.h @@ -144,7 +144,6 @@ struct plist { (struct plnstr *) ef_ptr(EF_PLANE, n) extern struct plchrstr plchr[N_MAXPLANE + 1]; -extern int pln_maxno; struct shiplist { short uid; diff --git a/src/lib/global/init.c b/src/lib/global/init.c index beb14f34..dc523542 100644 --- a/src/lib/global/init.c +++ b/src/lib/global/init.c @@ -76,7 +76,7 @@ init_plchr(void) struct plchrstr *pp; int pcount; - for (pp = plchr, pcount = 0; pcount < pln_maxno; pcount++, pp++) { + for (pp = plchr; pp->pl_name; pp++) { if (pp->pl_flags & P_M) pp->pl_flags |= P_V; } diff --git a/src/lib/global/plane.c b/src/lib/global/plane.c index 17f9a1c7..d3fea997 100644 --- a/src/lib/global/plane.c +++ b/src/lib/global/plane.c @@ -301,9 +301,8 @@ struct plchrstr plchr[] = { 0, P_N | P_M}, { - "", 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + NULL, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} }; - -int pln_maxno = (sizeof(plchr) / sizeof(struct plchrstr)) - 1; diff --git a/src/lib/subs/show.c b/src/lib/subs/show.c index 10a90553..842143bc 100644 --- a/src/lib/subs/show.c +++ b/src/lib/subs/show.c @@ -97,7 +97,7 @@ make_new_list(int tlev, int type) lookup_list_cnt = 0; if (type == EF_PLANE) { - for (pp = plchr, count = 0; count < pln_maxno; count++, pp++) { + for (pp = plchr; pp->pl_name; pp++) { if (pp->pl_tech > tlev) continue; if (pp->pl_name == 0 || pp->pl_name[0] == '\0') diff --git a/src/server/main.c b/src/server/main.c index 9f6258d2..aa53e27e 100644 --- a/src/server/main.c +++ b/src/server/main.c @@ -495,7 +495,7 @@ nullify_objects(void) dchr[SCT_OIL].d_cost = -1; dchr[SCT_REFINE].d_cost = -1; } - for (i = 0; i < pln_maxno; i++) { + for (i = 0; i < plchr[i].pl_name; i++) { if (opt_NO_HCMS) plchr[i].pl_hcm = 0; if (opt_NO_LCMS)