/*
* Empire - A multi-player, client/server Internet based war game.
- * Copyright (C) 1986-2006, Dave Pare, Jeff Bailey, Thomas Ruschak,
+ * Copyright (C) 1986-2008, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Ken Stevens, Steve McClure
*
* This program is free software; you can redistribute it and/or modify
#include <config.h>
-#include "misc.h"
-#include "player.h"
-#include "sect.h"
-#include "item.h"
+#include <ctype.h>
+#include "damage.h"
#include "file.h"
-#include "xy.h"
-#include "path.h"
-#include "nat.h"
#include "map.h"
-#include "nsc.h"
-#include "damage.h"
+#include "path.h"
+#include "player.h"
#include "prototypes.h"
+#include "sect.h"
static int move_map(coord curx, coord cury, char *arg);
double sect_mcost;
double total_mcost;
double mv_cost;
- double mobility = (double)start->sct_mobil;
+ double mobility = start->sct_mobil;
int dir;
int intcost;
int takedam = *dam;
}
pr("Looking for best path to %s\n", path);
path = BestLandPath(buf2, start, &ending_sect, &total_mcost,
- MOB_ROAD);
+ MOB_MOVE);
if (exploring && path) /* take off the 'h' */
path[strlen(path) - 1] = '\0';
if (!path)
if (movstr && sarg_xy(movstr, &dx, &dy)) {
if (getsect(dx, dy, &dsect)) {
movstr = BestLandPath(buf2, §, &dsect, &mv_cost,
- MOB_ROAD);
+ MOB_MOVE);
} else {
pr("Invalid destination sector!\n");
movstr = NULL;
*movstr = 0;
continue;
}
- movstr++;
+ do movstr++; while (isspace(*movstr));
if (dir == DIR_MAP) {
if (!exploring)
- map(curx, cury, movstr + 1);
+ map(curx, cury, movstr);
*movstr = 0;
continue;
} else if (dir == DIR_STOP)
break;
else if (dir == DIR_VIEW) {
pr("%d%% %s with %d civilians.\n", sect.sct_effic,
- dchr[sect.sct_type].d_name,
- sect.sct_item[I_CIVIL]);
+ dchr[sect.sct_type].d_name, sect.sct_item[I_CIVIL]);
continue;
}
/*
*movstr = 0;
continue;
}
- sect_mcost = sector_mcost(&next, MOB_ROAD);
+ sect_mcost = sector_mcost(&next, MOB_MOVE);
if ((!player->owner && (!exploring
|| next.sct_item[I_MILIT]
|| next.sct_item[I_CIVIL]))
if (takedam && chance(weight / 100.0) &&
((curx != oldx) || (cury != oldy)))
*dam += ground_interdict(curx, cury, player->cnum,
- "commodities");
+ "commodities");
if (*dam >= 100)
break;
}