char *pt = pathtaken;
char bmap_flag;
int ac;
+ short type;
leader = get_leader(unit_list);
leader_uid = leader->uid;
+ type = leader->ef_type;
pr("%s is %s\n",
- leader->ef_type == EF_SHIP ? "Flagship" : "Leader",
+ type == EF_SHIP ? "Flagship" : "Leader",
obj_nameof(leader));
if (player->argp[2]) {
strcpy(buf, player->argp[2]);
- if (leader->ef_type == EF_SHIP) {
+ if (type == EF_SHIP) {
if (!(cp = shp_path(*together, (struct shpstr *)leader, buf)))
cp = player->argp[2];
} else {
if (cp == NULL || *cp == '\0' || stopping) {
stopping = 0;
- if (leader->ef_type == EF_SHIP)
+ if (type == EF_SHIP)
shp_nav(unit_list, minmob, maxmob, together, player->cnum);
else
lnd_mar(unit_list, minmob, maxmob, together, player->cnum);
if (QEMPTY(unit_list)) {
pr("No %s left\n",
- leader->ef_type == EF_SHIP ? "ships" : "lands");
+ type == EF_SHIP ? "ships" : "lands");
if (strlen(pathtaken) > 0) {
pathtaken[strlen(pathtaken) - 1] = '\0';
- if (leader->ef_type == EF_SHIP && strlen(pathtaken) > 0)
+ if (type == EF_SHIP && strlen(pathtaken) > 0)
pr("Path taken: %s\n", pathtaken);
}
return RET_OK;
}
if (!skip)
nav_map(leader->x, leader->y,
- leader->ef_type == EF_SHIP ?
+ type == EF_SHIP ?
!(mchr[(int)leader->type].m_flags & M_SUB) : 1);
else
skip = 0;
/* Just in case any of our units were shelled while we were
* at the prompt, we call shp_nav() or lnd_mar() again.
*/
- if (leader->ef_type == EF_SHIP)
+ if (type == EF_SHIP)
shp_nav(unit_list, minmob, maxmob, together, player->cnum);
else
lnd_mar(unit_list, minmob, maxmob, together, player->cnum);
if (QEMPTY(unit_list)) {
pr("No %s left\n",
- leader->ef_type == EF_SHIP ? "ships" : "lands");
+ type == EF_SHIP ? "ships" : "lands");
if (strlen(pathtaken) > 0) {
pathtaken[strlen(pathtaken) - 1] = '\0';
- if (leader->ef_type == EF_SHIP && strlen(pathtaken) > 0)
+ if (type == EF_SHIP && strlen(pathtaken) > 0)
pr("Path taken: %s\n", pathtaken);
}
return RET_OK;
stopping = 1;
continue;
}
- if (leader->ef_type == EF_SHIP) {
+ if (type == EF_SHIP) {
if (!(cp = shp_path(*together, (struct shpstr *)leader,
buf)))
cp = buf;
cp = buf;
}
}
- if (leader->ef_type == EF_SHIP) {
+ if (type == EF_SHIP) {
radmapnopr(leader->x, leader->y, (int)leader->effic,
(int)techfact(leader->tech,
mchr[(int)leader->type].m_vrnge),
cp = &dirch[DIR_STOP];
dir = chkdir(*cp, DIR_STOP, DIR_LAST);
if (dir >= 0) {
- if (leader->ef_type == EF_SHIP) {
+ if (type == EF_SHIP) {
stopping |= shp_nav_one_sector(unit_list, dir,
player->cnum, *together);
if (stopping != 2) {
}
continue;
case 'i':
- if (leader->ef_type == EF_SHIP)
+ if (type == EF_SHIP)
shp_list(unit_list);
else
lnd_list(unit_list);
continue;
case 'm':
- if (leader->ef_type == EF_SHIP)
+ if (type == EF_SHIP)
stopping |= shp_sweep(unit_list, 1, 1, player->cnum);
else {
lnd_sweep(unit_list, 1, 1, player->cnum);
player->btused++;
continue;
case 'l':
- if (leader->ef_type == EF_SHIP)
+ if (type == EF_SHIP)
look();
else
llook();
sprintf(dp, "%d", leader->uid);
player->argp[1] = dp;
}
- if (leader->ef_type == EF_SHIP)
+ if (type == EF_SHIP)
mine();
else
landmine();
continue;
}
direrr("`%c' to stop",
- leader->ef_type == EF_SHIP ? ", `%c' to view" : NULL, NULL);
+ type == EF_SHIP ? ", `%c' to view" : NULL, NULL);
pr(", `i' to list %s, `f' to change %s,\n",
- leader->ef_type == EF_SHIP ? "ships" : "units",
- leader->ef_type == EF_SHIP ? "flagship" : "leader");
+ type == EF_SHIP ? "ships" : "units",
+ type == EF_SHIP ? "flagship" : "leader");
pr("`r' to radar, %s`l' to look, `M' to map, `B' to bmap,\n",
- leader->ef_type == EF_SHIP ? "`s' to sonar, " : "");
+ type == EF_SHIP ? "`s' to sonar, " : "");
pr("`d' to drop mines, and `m' to minesweep\n");
stopping = 1;
}
if (strlen(pathtaken) > 0) {
pathtaken[strlen(pathtaken) - 1] = '\0';
- if (leader->ef_type == EF_SHIP && strlen(pathtaken) > 0)
+ if (type == EF_SHIP && strlen(pathtaken) > 0)
pr("Path taken: %s\n", pathtaken);
}
return RET_OK;