Combined struct llist and struct mlist into superset struct ulist.

(assa, set_leader, switch_leader, set_flagship, switch_flagship,
take_move_in_mob, get_land, ask_olist, att_get_defense,
get_dlist, get_ototal, get_dtotal, kill_land, att_infect_units,
put_land, att_reacting_units, count_bodies, att_fight,
send_reacting_units_home, take_def, ask_move_in, move_in_land,
lnd_print, lnd_delete, lnd_take_casualty, lnd_takemob,
lnd_sel, lnd_mar, lnd_put, lnd_sweep, contains_engineer,
lnd_check_mines, lnd_list, lnd_mess,
lnd_damage, lnd_easiest_target, lnd_mar_one_sector, shp_sel,
shp_nav, shp_put, shp_sweep, shp_check_one_mines, shp_check_mines,
shp_list, shp_mess, shp_count, shp_damage_one, shp_damage,
shp_contains, most_valuable_ship, shp_easiest_target,
shp_missile_interdiction, notify_coastguard,
shp_view, shp_nav_one_sector, shp_missdef, nav_ship,
fltp_to_list): Switch to struct ulist from either struct mlist
or struct llist.
This commit is contained in:
Ron Koenderink 2006-09-25 03:29:06 +00:00
parent 7d90028f20
commit cd8d742392
11 changed files with 514 additions and 471 deletions

View file

@ -36,11 +36,11 @@
#include <ctype.h>
#include "item.h"
#include "nsc.h"
#include "path.h"
#include "ship.h"
#include "update.h"
#include "empobj.h"
#include "unit.h"
static void swap(struct shpstr *);
@ -233,7 +233,7 @@ nav_ship(struct shpstr *sp)
char buf[1024];
struct emp_qelem ship_list;
struct emp_qelem *qp, *newqp;
struct mlist *mlp;
struct ulist *mlp;
int dummyint;
double dummydouble;
int dir;
@ -249,9 +249,9 @@ nav_ship(struct shpstr *sp)
/* Make a list of one ships so we can use the navi.c code */
emp_initque(&ship_list);
mlp = malloc(sizeof(struct mlist));
mlp->mcp = mchr + sp->shp_type;
mlp->ship = *sp;
mlp = malloc(sizeof(struct ulist));
mlp->chrp = (struct empobj_chr *)(mchr + sp->shp_type);
mlp->unit.ship = *sp;
mlp->mobil = sp->shp_mobil;
emp_insque(&mlp->queue, &ship_list);
@ -268,9 +268,10 @@ nav_ship(struct shpstr *sp)
sectp = getsectp(sp->shp_x, sp->shp_y);
if (opt_FUEL &&
sectp->sct_own != 0 &&
sp->shp_fuel <= 0 && mlp->mcp->m_fuelu != 0)
sp->shp_fuel <= 0 &&
((struct mchrstr *)mlp->chrp)->m_fuelu != 0)
auto_fuel_ship(sp);
mlp->ship.shp_fuel = sp->shp_fuel;
mlp->unit.ship.shp_fuel = sp->shp_fuel;
cp = BestShipPath(buf, sp->shp_x, sp->shp_y,
sp->shp_destx[0], sp->shp_desty[0],