subs: Factor out shp_nav_put_one()
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
This commit is contained in:
parent
86c7249ca9
commit
268b05225f
1 changed files with 12 additions and 8 deletions
|
@ -53,6 +53,7 @@
|
||||||
#include "unit.h"
|
#include "unit.h"
|
||||||
#include "xy.h"
|
#include "xy.h"
|
||||||
|
|
||||||
|
static void shp_nav_put_one(struct ulist *);
|
||||||
static int shp_check_one_mines(struct ulist *);
|
static int shp_check_one_mines(struct ulist *);
|
||||||
static int shp_hit_mine(struct shpstr *);
|
static int shp_hit_mine(struct shpstr *);
|
||||||
static void shp_stays(natid, char *, struct ulist *);
|
static void shp_stays(natid, char *, struct ulist *);
|
||||||
|
@ -193,13 +194,19 @@ shp_nav_put(struct emp_qelem *list, natid actor)
|
||||||
sp = &mlp->unit.ship;
|
sp = &mlp->unit.ship;
|
||||||
mpr(actor, "%s stopped at %s\n",
|
mpr(actor, "%s stopped at %s\n",
|
||||||
prship(sp), xyas(sp->shp_x, sp->shp_y, actor));
|
prship(sp), xyas(sp->shp_x, sp->shp_y, actor));
|
||||||
sp->shp_mobil = (int)mlp->mobil;
|
shp_nav_put_one(mlp);
|
||||||
putship(sp->shp_uid, sp);
|
|
||||||
emp_remque(qp);
|
|
||||||
free(qp);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
shp_nav_put_one(struct ulist *mlp)
|
||||||
|
{
|
||||||
|
mlp->unit.ship.shp_mobil = (int)mlp->mobil;
|
||||||
|
putship(mlp->unit.ship.shp_uid, &mlp->unit.ship);
|
||||||
|
emp_remque(&mlp->queue);
|
||||||
|
free(mlp);
|
||||||
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
shp_sweep(struct emp_qelem *ship_list, int verbose, int takemob, natid actor)
|
shp_sweep(struct emp_qelem *ship_list, int verbose, int takemob, natid actor)
|
||||||
{
|
{
|
||||||
|
@ -317,10 +324,7 @@ shp_stays(natid actor, char *str, struct ulist *mlp)
|
||||||
mpr(actor, "%s %s & stays in %s\n",
|
mpr(actor, "%s %s & stays in %s\n",
|
||||||
prship(&mlp->unit.ship), str,
|
prship(&mlp->unit.ship), str,
|
||||||
xyas(mlp->unit.ship.shp_x, mlp->unit.ship.shp_y, actor));
|
xyas(mlp->unit.ship.shp_x, mlp->unit.ship.shp_y, actor));
|
||||||
mlp->unit.ship.shp_mobil = (int)mlp->mobil;
|
shp_nav_put_one(mlp);
|
||||||
putship(mlp->unit.ship.shp_uid, &mlp->unit.ship);
|
|
||||||
emp_remque(&mlp->queue);
|
|
||||||
free(mlp);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue