/*
* Empire - A multi-player, client/server Internet based war game.
- * Copyright (C) 1986-2006, Dave Pare, Jeff Bailey, Thomas Ruschak,
+ * Copyright (C) 1986-2009, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Ken Stevens, Steve McClure
*
* This program is free software; you can redistribute it and/or modify
* ---
*
* move.c: Move something somewhere.
- *
+ *
* Known contributors to this file:
- *
+ *
*/
#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);
*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)
mobility -= sect_mcost;
total_mcost += sect_mcost;
}
- curx = tmpx;
- cury = tmpy;
+ curx = next.sct_x;
+ cury = next.sct_y;
if (cury != start->sct_y)
out = 1;
if (curx != start->sct_x)
i = 0;
while (i < 7 && nxtsct(&ns, §)) {
/* Nasty: this relies on the iteration order */
- if (!(view[i] = player->bmap[sctoff(ns.x, ns.y)]))
+ if (!(view[i] = player->bmap[sect.sct_uid]))
view[i] = ' ';
i++;
}