/*
* Empire - A multi-player, client/server Internet based war game.
- * Copyright (C) 1986-2011, Dave Pare, Jeff Bailey, Thomas Ruschak,
+ * Copyright (C) 1986-2015, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Ken Stevens, Steve McClure, Markus Armbruster
*
* Empire is free software: you can redistribute it and/or modify
* pathfind.c: Find cheapest paths
*
* Known contributors to this file:
- * Markus Armbruster, 2011
+ * Markus Armbruster, 2014
*/
#include <config.h>
return yy;
}
-static int
-rev_dir(int dir)
-{
- assert(DIR_FIRST <= dir && dir <= DIR_LAST);
- return dir >= DIR_FIRST + 3 ? dir - 3 : dir + 3;
-}
-
/*
* Set the current source and cost function.
* SX,SY is the source.
i = bufsz;
buf[--i] = dirch[d];
len++;
- x = x_in_dir(x, rev_dir(d));
- y = y_in_dir(y, rev_dir(d));
+ assert(DIR_FIRST <= d && d <= DIR_LAST);
+ x = x_in_dir(x, DIR_BACK(d));
+ y = y_in_dir(y, DIR_BACK(d));
}
assert(x == sx && y == sy);
cost_land(natid actor, int uid, int mobtype)
{
/*
- * Non-negative cost must not depend on ACTOR, see BestLandPath().
+ * Non-negative cost must not depend on ACTOR, see unit_path().
*/
struct sctstr *sp = (void *)empfile[EF_SECTOR].cache;