(struct shpstr *) ef_ptr(EF_SHIP, n)
extern struct mchrstr mchr[N_MAXSHIPS + 1];
-extern int shp_maxno;
struct mlist {
struct emp_qelem queue; /* list of ships */
init_pchr();
init_mchr();
init_plchr();
- /* the same thing should be done for units... */
}
static void
init_mchr(void)
{
struct mchrstr *mp;
- int n;
- for (mp = mchr, n = 0; n < shp_maxno; n++, mp++) {
+ for (mp = mchr; mp->m_name; mp++) {
if (mp->m_nxlight)
mp->m_flags |= M_XLIGHT;
if (mp->m_nchoppers)
init_plchr(void)
{
struct plchrstr *pp;
- int pcount;
for (pp = plchr; pp->pl_name; pp++) {
if (pp->pl_flags & P_M)
360, 1500, M_SUPPLY, 0, 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, NULL,
0, 0, 0, 0, 0}
};
-
-int shp_maxno = (sizeof(mchr) / sizeof(struct mchrstr)) - 1;
struct plchrstr *pp;
struct lchrstr *lp;
struct mchrstr *mp;
- int count;
lookup_list_cnt = 0;
if (type == EF_PLANE) {
for (pp = plchr; pp->pl_name; pp++) {
if (pp->pl_tech > tlev)
continue;
- if (pp->pl_name == 0 || pp->pl_name[0] == '\0')
- continue;
lookup_list[lookup_list_cnt].l_u.pp = pp;
lookup_list[lookup_list_cnt].tech = pp->pl_tech;
lookup_list_cnt++;
}
} else if (type == EF_SHIP) {
- for (mp = mchr, count = 0; count < shp_maxno; count++, mp++) {
+ for (mp = mchr; mp->m_name; mp++) {
if (mp->m_tech > tlev)
continue;
- if (mp->m_name == 0 || mp->m_name[0] == '\0')
- continue;
lookup_list[lookup_list_cnt].l_u.mp = mp;
lookup_list[lookup_list_cnt].tech = mp->m_tech;
lookup_list_cnt++;
/* Fix up the military values */
lchr[i].l_mil = lchr[i].l_item[I_MILIT];
}
- for (i = 0; i < shp_maxno; i++) {
+ for (i = 0; i < mchr[i].m_name; i++) {
if (opt_NO_HCMS)
mchr[i].m_hcm = 0;
if (opt_NO_LCMS)