#define MOB_SAIL 3
#define MOB_FLY 4
-enum p_mode { /* How to find path to destination */
- P_NONE, /* don't */
- P_FLYING, /* use BestAirPath() */
- P_SAILING /* use BestShipPath() */
-};
-
/* src/lib/global/dir.c */
extern signed char dirindex['z'-'a'+1];
extern int diroff[DIR_MAP+1][2];
#endif
/* src/lib/subs/paths.c */
-extern char *getpath(char *, char *, coord, coord, int, int, enum p_mode);
+extern char *getpath(char *, char *, coord, coord, int, int, int);
extern double fcost(struct sctstr *, natid);
extern double ncost(struct sctstr *, natid);
extern double pathtoxy(char *, coord *, coord *,
* Dave Pare, 1986
* Ken Stevens, 1995
* Steve McClure, 1998-2000
- * Markus Armbruster, 2004-2009
+ * Markus Armbruster, 2004-2011
*/
#include <config.h>
return RET_SYN;
ax = ap_sect.sct_x;
ay = ap_sect.sct_y;
- if (!getpath(flightpath, player->argp[5], ax, ay, 0, 0, P_FLYING)
+ if (!getpath(flightpath, player->argp[5], ax, ay, 0, 0, MOB_FLY)
|| *flightpath == 0)
return RET_SYN;
tx = ax;
*
* Known contributors to this file:
* Dave Pare, 1986
- * Markus Armbruster, 2004-2009
+ * Markus Armbruster, 2004-2011
*/
#include <config.h>
return RET_SYN;
ax = ap_sect.sct_x;
ay = ap_sect.sct_y;
- if (!getpath(flightpath, player->argp[4], ax, ay, 0, 0, P_FLYING)
+ if (!getpath(flightpath, player->argp[4], ax, ay, 0, 0, MOB_FLY)
|| *flightpath == 0)
return RET_SYN;
tx = ax;
* Known contributors to this file:
* Dave Pare, 1986
* Steve McClure, 2000
- * Markus Armbruster, 2004-2009
+ * Markus Armbruster, 2004-2011
*/
#include <config.h>
return RET_SYN;
ax = ap_sect.sct_x;
ay = ap_sect.sct_y;
- if (!getpath(flightpath, player->argp[4], ax, ay, 0, 0, P_FLYING)
+ if (!getpath(flightpath, player->argp[4], ax, ay, 0, 0, MOB_FLY)
|| *flightpath == 0)
return RET_SYN;
tx = ax;
* Known contributors to this file:
* Dave Pare, 1986
* Ken Stevens, 1995
- * Markus Armbruster, 2004-2009
+ * Markus Armbruster, 2004-2011
*/
#include <config.h>
return RET_SYN;
ax = ap_sect.sct_x;
ay = ap_sect.sct_y;
- if (!getpath(flightpath, player->argp[4], ax, ay, 0, 0, P_FLYING)
+ if (!getpath(flightpath, player->argp[4], ax, ay, 0, 0, MOB_FLY)
|| *flightpath == 0)
return RET_SYN;
tx = ax;
*
* Known contributors to this file:
* Dave Pare, 1986
- * Markus Armbruster, 2004-2009
+ * Markus Armbruster, 2004-2011
*/
#include <config.h>
return RET_SYN;
ax = ap_sect.sct_x;
ay = ap_sect.sct_y;
- if (!getpath(flightpath, player->argp[4], ax, ay, 0, 0, P_FLYING)
+ if (!getpath(flightpath, player->argp[4], ax, ay, 0, 0, MOB_FLY)
|| *flightpath == 0)
return RET_SYN;
tx = ax;
pr("Ship #%d at %s\n", ship.shp_uid,
xyas(ship.shp_x, ship.shp_y, player->cnum));
cp = getpath(navpath, player->argp[2],
- ship.shp_x, ship.shp_y, 0, 0, P_SAILING);
+ ship.shp_x, ship.shp_y, 0, 0, MOB_SAIL);
if (!cp)
return RET_FAIL;
if (!check_ship_ok(&ship))
* which do not accept partial moves.
*/
char *
-getpath(char *buf, char *arg, coord x, coord y, int onlyown,
- int showdes, enum p_mode destinations)
+getpath(char *buf, char *arg, coord x, coord y, int onlyown, int showdes,
+ int mobtype)
{
char buf2[1024];
char *p = buf;
while (*p) {
if (sarg_xy(p, &dx, &dy)) {
bp = NULL;
- switch (destinations) {
- case P_NONE:
+ switch (mobtype) {
+ default:
+ CANT_REACH();
pr("Destination sectors not allowed here!\n");
break;
- case P_FLYING:
+ case MOB_FLY:
if (path_find(x, y, dx, dy, 0, MOB_FLY) < 0)
bp = NULL;
else {
}
}
break;
- case P_SAILING:
+ case MOB_SAIL:
if (path_find(x, y, dx, dy, player->cnum, MOB_SAIL) < 0)
bp = NULL;
else {