/*
* Empire - A multi-player, client/server Internet based war game.
- * Copyright (C) 1986-2008, Dave Pare, Jeff Bailey, Thomas Ruschak,
- * Ken Stevens, Steve McClure
+ * Copyright (C) 1986-2011, Dave Pare, Jeff Bailey, Thomas Ruschak,
+ * Ken Stevens, Steve McClure, Markus Armbruster
*
- * This program is free software; you can redistribute it and/or modify
+ * Empire is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
+ * the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* ---
*
* ---
*
* bestpath.c: Find the best path between sectors
- *
+ *
* Known contributors to this file:
* Steve McClure, 1998-2000
* Markus Armbruster, 2006
*/
-/*
+/*
* IMPORTANT: These routines are very selectively used in the server.
*
* "bestownedpath" is only used to determine paths for ships and planes.
- *
+ *
* Callers should not be calling these directly anymore. They should use
* the "BestShipPath", "BestAirPath", "BestLandPath" and "BestDistPath"
* functions. Note that those last two use the A* algorithms to find
routelen = 0; /* path length is now 0 */
mapindex[x][y] = 0; /* mark starting spot */
- markedsectors = 1; /* source sector marked */
minx = x - 2; /* set X scan bounds */
maxx = x + 2;
miny = y - 1; /* set Y scan bounds */
/* Owned or allied sector? Check the real sector. */
getsect(x, y, §);
- if (sect.sct_own == own
- || (sect.sct_own && getrel(getnatp(sect.sct_own), own) == ALLIED)) {
+ if (sect.sct_own && relations_with(sect.sct_own, own) == ALLIED) {
/* FIXME duplicates shp_check_nav() logic */
switch (dchr[sect.sct_type].d_nav) {
case NAVOK: