/*
* Empire - A multi-player, client/server Internet based war game.
- * Copyright (C) 1986-2015, Dave Pare, Jeff Bailey, Thomas Ruschak,
+ * Copyright (C) 1986-2021, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Ken Stevens, Steve McClure, Markus Armbruster
*
* Empire is free software: you can redistribute it and/or modify
#include <config.h>
#include <math.h>
-#include "file.h"
#include "map.h"
#include "optlist.h"
#include "path.h"
if (leader->ef_type != EF_SHIP)
return NULL;
cp = unit_move_parse(cp, leader_str);
- sona();
+ c_sonar();
player->btused++; /* FIXME likewise */
*map_shown = 1;
break;
player->argp[1] = leader_str;
}
if (leader->ef_type == EF_SHIP)
- mine();
+ c_mine();
else
- landmine();
+ c_lmine();
player->btused++; /* FIXME likewise */
*map_shown = 1;
break;
*/
if (!*cp) {
cp = unit_move_getpath(list, suppress_map, path);
- if (!cp)
+ if (!cp) {
+ if (type == EF_SHIP) {
+ shp_nav_stay_behind(list, player->cnum);
+ shp_nav_put(list, player->cnum);
+ } else {
+ lnd_mar_stay_behind(list, player->cnum);
+ lnd_mar_put(list, player->cnum);
+ }
return RET_FAIL;
+ }
cp = unit_move_route(leader, path, sizeof(path));
if (!cp || !*cp)
cp = "h";
stopping = shp_nav_dir(list, dir, player->cnum)
|| shp_nav_gauntlet(list, 1, player->cnum);
else {
- if (!moved && !lnd_abandon_askyn(list))
+ if (!moved && !lnd_abandon_askyn(list)) {
+ lnd_mar_put(list, player->cnum);
return RET_FAIL;
+ }
stopping = lnd_mar_dir(list, dir, player->cnum)
|| lnd_mar_gauntlet(list, 1, player->cnum);
}
- if (dir == DIR_STOP)
+ if (dir == DIR_STOP) {
+ CANT_HAPPEN(!QEMPTY(list));
return RET_OK;
+ }
moved = 1;
if (stopping)
cp = "";
type == EF_SHIP ? "flagship" : "leader");
pr("`r' to radar, %s`l' to look, `M' to map, `B' to bmap,\n",
type == EF_SHIP ? "`s' to sonar, " : "");
- pr("`d' to drop mines, and `m' to minesweep\n");
+ pr("`d' to drop mines, and `m' to sweep mines\n");
cp = "";
}
}