/*
* Empire - A multi-player, client/server Internet based war game.
- * Copyright (C) 1986-2011, Dave Pare, Jeff Bailey, Thomas Ruschak,
+ * Copyright (C) 1986-2012, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Ken Stevens, Steve McClure, Markus Armbruster
*
* Empire is free software: you can redistribute it and/or modify
return;
if (type == EF_LAND)
- pr("lnd# land type x,y a eff sh gun xl mu tech retr\n");
+ pr("lnd# land type x,y a eff mil sh gun xl ln mu tech retr\n");
else
pr("shp# ship type x,y fl eff mil sh gun pn he xl ln mob tech\n");
pr("%1.1s", &unit->group);
pr("%4d%%", unit->effic);
if (type == EF_LAND) {
+ pr("%4d", lnd->lnd_item[I_MILIT]);
pr("%4d", lnd->lnd_item[I_SHELL]);
pr("%4d", lnd->lnd_item[I_GUN]);
- pr("%3d", lnd_nxlight(lnd));
+ pr("%3d%3d", lnd_nxlight(lnd), lnd_nland(lnd));
} else {
pr("%4d", shp->shp_item[I_MILIT]);
pr("%4d", shp->shp_item[I_SHELL]);
}
char *
-unit_path(int together, struct empobj *unit, char *buf)
+unit_path(int together, struct empobj *unit, char *buf, size_t bufsz)
{
coord destx;
coord desty;
return NULL;
}
}
- len = path_find_route(buf, sizeof(buf), unit->x, unit->y, destx, desty);
+ len = path_find_route(buf, bufsz, unit->x, unit->y, destx, desty);
if (len == 0 || unit->ef_type == EF_LAND) {
- if (len + 1 < sizeof(buf))
+ if (len + 1 < bufsz)
strcpy(buf + len, "h");
len++;
}
- if (len >= sizeof(buf)) {
+ if (len >= bufsz) {
pr("Can't handle path to %s, it's too long, sorry\n",
xyas(destx, desty, player->cnum));
return NULL;