subs: Split unit_put() into shp_put() and lnd_put() again

Commit d94d269 combined them into unit_put(), but that has turned out
not to be useful.  Split them again.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
This commit is contained in:
Markus Armbruster 2014-01-25 15:41:58 +01:00
parent 62b9399cdf
commit b5ffc1ca49
8 changed files with 52 additions and 41 deletions

View file

@ -180,6 +180,26 @@ shp_nav(struct emp_qelem *list, double *minmobp, double *maxmobp,
}
}
void
shp_put(struct emp_qelem *list, natid actor)
{
struct emp_qelem *qp, *next;
struct ulist *mlp;
struct shpstr *sp;
for (qp = list->q_back; qp != list; qp = next) {
next = qp->q_back;
mlp = (struct ulist *)qp;
sp = &mlp->unit.ship;
mpr(actor, "%s stopped at %s\n",
prship(sp), xyas(sp->shp_x, sp->shp_y, actor));
sp->shp_mobil = (int)mlp->mobil;
putship(sp->shp_uid, sp);
emp_remque(qp);
free(qp);
}
}
int
shp_sweep(struct emp_qelem *ship_list, int verbose, int takemob, natid actor)
{
@ -759,7 +779,7 @@ shp_nav_one_sector(struct emp_qelem *list, int dir, natid actor,
int navigate;
if (dir <= DIR_STOP || dir >= DIR_VIEW) {
unit_put(list, actor);
shp_put(list, actor);
return 1;
}
dx = diroff[dir][0];