Get rid of struct plnstr member pln_nuktype
pln_nuktype is redundant; it can be computed from the nuke's nuk_plane. Make plane selector nuketype virtual and NSC_EXTRA. It should have been NSC_EXTRA all along. This changes xdump plane. Don't set it in arm(), disarm(), build_plane(), pln_damage() and nuk_fixup(). The latter no longer does anything, remove it. Deprecate edit key 'n' in doplane(), and don't show it in pr_plane(). The key never made much sense. eff_bomb(), comm_bomb(), ship_bomb(), plane_bomb(), land_bomb(), strat_bomb(), mission_pln_equip(), air_damage(), msl_hit(), pln_equip() tested pln_nuketype to check whether a plane carries a nuke. Test nuk_on_plane() instead. pdump(), plan(), trade_desc() print whether and what kind of nuke a plane carries. Adapt that to use nuk_on_plane().
This commit is contained in:
parent
4086c25a15
commit
8b1470e3a8
13 changed files with 40 additions and 56 deletions
|
@ -46,6 +46,7 @@ plan(void)
|
|||
int nplanes, noff;
|
||||
struct nstr_item np;
|
||||
struct plnstr plane;
|
||||
struct nukstr nuke;
|
||||
|
||||
if (!snxtitem(&np, EF_PLANE, player->argp[1], NULL))
|
||||
return RET_SYN;
|
||||
|
@ -76,9 +77,9 @@ plan(void)
|
|||
pr(" ");
|
||||
if (pln_is_in_orbit(&plane))
|
||||
pr((plane.pln_flags & PLN_SYNCHRONOUS) ? " geosync" : " orbit");
|
||||
else if (plane.pln_nuketype >= 0)
|
||||
else if (getnuke(nuk_on_plane(&plane), &nuke))
|
||||
pr(" %-5.5s %c",
|
||||
nchr[(int)plane.pln_nuketype].n_name,
|
||||
nchr[nuke.nuk_type].n_name,
|
||||
plane.pln_flags & PLN_AIRBURST ? 'A' : 'G');
|
||||
pr("\n");
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue