Move show_mission() to sole caller, give it internal linkage
This commit is contained in:
parent
c1b76a1a2f
commit
7ac151acac
3 changed files with 44 additions and 43 deletions
|
@ -40,6 +40,8 @@
|
|||
#include "optlist.h"
|
||||
#include "path.h"
|
||||
|
||||
static void show_mission(int, struct nstr_item *);
|
||||
|
||||
/*
|
||||
* mission <type> <planes/ships/units> <mission type> <op sector> [<radius>]
|
||||
*/
|
||||
|
@ -301,3 +303,45 @@ mission(void)
|
|||
pr("%d %s%s\n", num, ef_nameof(type), splur(num));
|
||||
return RET_OK;
|
||||
}
|
||||
|
||||
static void
|
||||
show_mission(int type, struct nstr_item *np)
|
||||
{
|
||||
int first = 1;
|
||||
union empobj_storage item;
|
||||
struct empobj *gp;
|
||||
|
||||
while (nxtitem(np, &item)) {
|
||||
gp = (struct empobj *)&item;
|
||||
if (!player->owner || gp->own == 0)
|
||||
continue;
|
||||
|
||||
if (first) {
|
||||
pr("Thing x,y op-sect rad mission\n");
|
||||
first = 0;
|
||||
}
|
||||
pr("%-25s", obj_nameof(gp));
|
||||
prxy(" %3d,%-3d", gp->x, gp->y, player->cnum);
|
||||
switch (gp->mission) {
|
||||
case MI_INTERDICT:
|
||||
case MI_SUPPORT:
|
||||
case MI_RESERVE:
|
||||
case MI_ESCORT:
|
||||
case MI_AIR_DEFENSE:
|
||||
case MI_DSUPPORT:
|
||||
case MI_OSUPPORT:
|
||||
prxy(" %3d,%-3d", gp->opx, gp->opy, player->cnum);
|
||||
pr(" %4d", gp->radius);
|
||||
break;
|
||||
default:
|
||||
CANT_REACH();
|
||||
/* fall through */
|
||||
case MI_NONE:
|
||||
pr(" ");
|
||||
}
|
||||
if (gp->mission)
|
||||
pr(" is on %s mission\n", mission_name(gp->mission));
|
||||
else
|
||||
pr(" has no mission.\n");
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue