(shp_maxno): Variable's value is well-known constant N_MAXSHIPS + 1.
Useless, remove. Users changed to check mchr's sentinel, because that's clearer than comparing the index to N_MAXSHIPS or sizeof(mchr) / sizeof(*mchr). (mchr): Change sentinel's m_name to NULL.
This commit is contained in:
parent
47192c9079
commit
e23d8a8fac
5 changed files with 4 additions and 15 deletions
|
@ -93,25 +93,20 @@ make_new_list(int tlev, int type)
|
|||
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++;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue