Break lines more tastefully.

This commit is contained in:
Markus Armbruster 2006-05-14 07:52:20 +00:00
parent fcc0162188
commit 5b4b3a13cb
40 changed files with 220 additions and 229 deletions

View file

@ -167,8 +167,8 @@ extern int as_search(struct as_data *adp);
extern void as_delete(struct as_data *adp); extern void as_delete(struct as_data *adp);
extern void as_reset(struct as_data *adp); extern void as_reset(struct as_data *adp);
extern void as_stats(struct as_data *adp, FILE * fp); extern void as_stats(struct as_data *adp, FILE * fp);
extern struct as_path *as_find_cachepath(coord fx, extern struct as_path *as_find_cachepath(coord fx, coord fy,
coord fy, coord tx, coord ty); coord tx, coord ty);
/* Functions that are "private" to algorithm */ /* Functions that are "private" to algorithm */

View file

@ -137,8 +137,8 @@ add(void)
snxtitem_all(&ni, EF_LAND); snxtitem_all(&ni, EF_LAND);
while (nxtitem(&ni, &land)) { while (nxtitem(&ni, &land)) {
if (land.lnd_own == coun) { if (land.lnd_own == coun) {
makelost(EF_LAND, land.lnd_own, land.lnd_uid, land.lnd_x, makelost(EF_LAND, land.lnd_own, land.lnd_uid,
land.lnd_y); land.lnd_x, land.lnd_y);
land.lnd_own = 0; land.lnd_own = 0;
pr("Land unit %d wiped\n", land.lnd_uid); pr("Land unit %d wiped\n", land.lnd_uid);
putland(land.lnd_uid, &land); putland(land.lnd_uid, &land);

View file

@ -146,10 +146,10 @@ anti(void)
sect.sct_item[I_MILIT] = ache; sect.sct_item[I_MILIT] = ache;
if (sect.sct_own == sect.sct_oldown) if (sect.sct_own == sect.sct_oldown)
sect.sct_oldown = 0; sect.sct_oldown = 0;
makelost(EF_SECTOR, sect.sct_own, 0, sect.sct_x, makelost(EF_SECTOR, sect.sct_own, 0,
sect.sct_y); sect.sct_x, sect.sct_y);
makenotlost(EF_SECTOR, sect.sct_oldown, 0, sect.sct_x, makenotlost(EF_SECTOR, sect.sct_oldown, 0,
sect.sct_y); sect.sct_x, sect.sct_y);
sect.sct_own = sect.sct_oldown; sect.sct_own = sect.sct_oldown;
sect.sct_off = 1; /* Turn the sector off */ sect.sct_off = 1; /* Turn the sector off */
putsect(&sect); putsect(&sect);

View file

@ -545,8 +545,8 @@ ship_bomb(struct emp_qelem *list, struct sctstr *target)
if (gun > 0) { if (gun > 0) {
shell = ship.shp_item[I_SHELL]; shell = ship.shp_item[I_SHELL];
if (shell <= 0) if (shell <= 0)
shell = supply_commod(ship.shp_own, ship.shp_x, shell = supply_commod(ship.shp_own,
ship.shp_y, I_SHELL, 1); ship.shp_x, ship.shp_y, I_SHELL, 1);
} }
mcp = &mchr[(int)ship.shp_type]; mcp = &mchr[(int)ship.shp_type];
if (gun > 0 && shell > 0 && !(mcp->m_flags & M_SUB)) { if (gun > 0 && shell > 0 && !(mcp->m_flags & M_SUB)) {
@ -694,8 +694,8 @@ plane_bomb(struct emp_qelem *list, struct sctstr *target)
own = plane.pln_own; own = plane.pln_own;
if (dam > plane.pln_effic) { if (dam > plane.pln_effic) {
plane.pln_effic = 0; plane.pln_effic = 0;
makelost(EF_PLANE, plane.pln_own, plane.pln_uid, plane.pln_x, makelost(EF_PLANE, plane.pln_own, plane.pln_uid,
plane.pln_y); plane.pln_x, plane.pln_y);
plane.pln_own = 0; plane.pln_own = 0;
} else } else
plane.pln_effic -= dam; plane.pln_effic -= dam;

View file

@ -390,8 +390,8 @@ build_ship(struct sctstr *sp, struct mchrstr *mp, short *vec, int tlev)
if (sp->sct_pstage == PLG_INFECT) if (sp->sct_pstage == PLG_INFECT)
ship.shp_pstage = PLG_EXPOSED; ship.shp_pstage = PLG_EXPOSED;
makenotlost(EF_SHIP, ship.shp_own, ship.shp_uid, ship.shp_x, makenotlost(EF_SHIP, ship.shp_own, ship.shp_uid,
ship.shp_y); ship.shp_x, ship.shp_y);
putship(ship.shp_uid, &ship); putship(ship.shp_uid, &ship);
pr("%s", prship(&ship)); pr("%s", prship(&ship));
pr(" built in sector %s\n", xyas(sp->sct_x, sp->sct_y, player->cnum)); pr(" built in sector %s\n", xyas(sp->sct_x, sp->sct_y, player->cnum));
@ -516,8 +516,8 @@ build_land(struct sctstr *sp, struct lchrstr *lp, short *vec, int tlev)
if (sp->sct_pstage == PLG_INFECT) if (sp->sct_pstage == PLG_INFECT)
land.lnd_pstage = PLG_EXPOSED; land.lnd_pstage = PLG_EXPOSED;
putland(nstr.cur, &land); putland(nstr.cur, &land);
makenotlost(EF_LAND, land.lnd_own, land.lnd_uid, land.lnd_x, makenotlost(EF_LAND, land.lnd_own, land.lnd_uid,
land.lnd_y); land.lnd_x, land.lnd_y);
pr("%s", prland(&land)); pr("%s", prland(&land));
pr(" built in sector %s\n", xyas(sp->sct_x, sp->sct_y, player->cnum)); pr(" built in sector %s\n", xyas(sp->sct_x, sp->sct_y, player->cnum));
return 1; return 1;
@ -807,8 +807,8 @@ build_plane(struct sctstr *sp, struct plchrstr *pp, short *vec, int tlev)
vec[I_HCM] -= hcm; vec[I_HCM] -= hcm;
vec[I_MILIT] -= mil; vec[I_MILIT] -= mil;
makenotlost(EF_PLANE, plane.pln_own, plane.pln_uid, plane.pln_x, makenotlost(EF_PLANE, plane.pln_own, plane.pln_uid,
plane.pln_y); plane.pln_x, plane.pln_y);
putplane(plane.pln_uid, &plane); putplane(plane.pln_uid, &plane);
pr("%s built in sector %s\n", prplane(&plane), pr("%s built in sector %s\n", prplane(&plane),
xyas(sp->sct_x, sp->sct_y, player->cnum)); xyas(sp->sct_x, sp->sct_y, player->cnum));

View file

@ -218,8 +218,8 @@ grab_sect(struct sctstr *sp, natid to)
prplane(pp), cname(player->cnum)); prplane(pp), cname(player->cnum));
makelost(EF_PLANE, pp->pln_own, pp->pln_uid, pp->pln_x, pp->pln_y); makelost(EF_PLANE, pp->pln_own, pp->pln_uid, pp->pln_x, pp->pln_y);
pp->pln_own = to; pp->pln_own = to;
makenotlost(EF_PLANE, pp->pln_own, pp->pln_uid, pp->pln_x, makenotlost(EF_PLANE, pp->pln_own, pp->pln_uid,
pp->pln_y); pp->pln_x, pp->pln_y);
pp->pln_mobil = 0; pp->pln_mobil = 0;
pp->pln_mission = 0; pp->pln_mission = 0;
putplane(pp->pln_uid, pp); putplane(pp->pln_uid, pp);
@ -235,8 +235,8 @@ grab_sect(struct sctstr *sp, natid to)
prnuke(np), cname(player->cnum)); prnuke(np), cname(player->cnum));
makelost(EF_NUKE, np->nuk_own, np->nuk_uid, np->nuk_x, np->nuk_y); makelost(EF_NUKE, np->nuk_own, np->nuk_uid, np->nuk_x, np->nuk_y);
np->nuk_own = to; np->nuk_own = to;
makenotlost(EF_NUKE, np->nuk_own, np->nuk_uid, np->nuk_x, makenotlost(EF_NUKE, np->nuk_own, np->nuk_uid,
np->nuk_y); np->nuk_x, np->nuk_y);
putnuke(ni.cur, np); putnuke(ni.cur, np);
} }
@ -347,8 +347,8 @@ grab_ship(struct shpstr *sp, natid to)
prplane(pp), cname(player->cnum)); prplane(pp), cname(player->cnum));
makelost(EF_PLANE, pp->pln_own, pp->pln_uid, pp->pln_x, pp->pln_y); makelost(EF_PLANE, pp->pln_own, pp->pln_uid, pp->pln_x, pp->pln_y);
pp->pln_own = to; pp->pln_own = to;
makenotlost(EF_PLANE, pp->pln_own, pp->pln_uid, pp->pln_x, makenotlost(EF_PLANE, pp->pln_own, pp->pln_uid,
pp->pln_y); pp->pln_x, pp->pln_y);
pp->pln_mobil = 0; pp->pln_mobil = 0;
pp->pln_mission = 0; pp->pln_mission = 0;
putplane(pp->pln_uid, pp); putplane(pp->pln_uid, pp);

View file

@ -483,13 +483,11 @@ doland(char op, int arg, char *p, struct sctstr *sect)
xyas(sect->sct_x, sect->sct_y, player->cnum), xyas(sect->sct_x, sect->sct_y, player->cnum),
cname(sect->sct_own), sect->sct_own, cname(newown), newown); cname(sect->sct_own), sect->sct_own, cname(newown), newown);
if (sect->sct_own) { if (sect->sct_own) {
makelost(EF_SECTOR, sect->sct_own, 0, sect->sct_x, makelost(EF_SECTOR, sect->sct_own, 0,
sect->sct_y); sect->sct_x, sect->sct_y);
wu(player->cnum, sect->sct_own, wu(player->cnum, sect->sct_own,
"Sector %s lost to deity intervention\n", xyas(sect->sct_x, "Sector %s lost to deity intervention\n",
sect->sct_y, xyas(sect->sct_x, sect->sct_y, sect->sct_own));
sect->
sct_own));
} }
benefit(sect->sct_own, 0); benefit(sect->sct_own, 0);
sect->sct_own = newown; sect->sct_own = newown;
@ -808,15 +806,15 @@ doship(char op, int arg, char *p, struct shpstr *ship)
if (arg && arg < MAXNOC) { if (arg && arg < MAXNOC) {
wu(player->cnum, (natid)arg, wu(player->cnum, (natid)arg,
"%s given to you by deity intervention!\n", prship(ship)); "%s given to you by deity intervention!\n", prship(ship));
makelost(EF_SHIP, ship->shp_own, ship->shp_uid, ship->shp_x, makelost(EF_SHIP, ship->shp_own, ship->shp_uid,
ship->shp_y); ship->shp_x, ship->shp_y);
ship->shp_own = (natid)arg; ship->shp_own = (natid)arg;
makenotlost(EF_SHIP, ship->shp_own, ship->shp_uid, ship->shp_x, makenotlost(EF_SHIP, ship->shp_own, ship->shp_uid,
ship->shp_y); ship->shp_x, ship->shp_y);
} else if (!arg) { } else if (!arg) {
ship->shp_effic = 0; ship->shp_effic = 0;
makelost(EF_SHIP, ship->shp_own, ship->shp_uid, ship->shp_x, makelost(EF_SHIP, ship->shp_own, ship->shp_uid,
ship->shp_y); ship->shp_x, ship->shp_y);
ship->shp_own = (natid)0; ship->shp_own = (natid)0;
} }
break; break;
@ -925,14 +923,14 @@ dounit(char op, int arg, char *p, struct lndstr *land)
if (arg && arg < MAXNOC) { if (arg && arg < MAXNOC) {
wu(player->cnum, (natid)arg, wu(player->cnum, (natid)arg,
"%s given to you by deity intervention!\n", prland(land)); "%s given to you by deity intervention!\n", prland(land));
makelost(EF_LAND, land->lnd_own, land->lnd_uid, land->lnd_x, makelost(EF_LAND, land->lnd_own, land->lnd_uid,
land->lnd_y); land->lnd_x, land->lnd_y);
land->lnd_own = (natid)arg; land->lnd_own = (natid)arg;
makenotlost(EF_LAND, land->lnd_own, land->lnd_uid, land->lnd_x, makenotlost(EF_LAND, land->lnd_own, land->lnd_uid,
land->lnd_y); land->lnd_x, land->lnd_y);
} else if (!arg) { } else if (!arg) {
makelost(EF_LAND, land->lnd_own, land->lnd_uid, land->lnd_x, makelost(EF_LAND, land->lnd_own, land->lnd_uid,
land->lnd_y); land->lnd_x, land->lnd_y);
land->lnd_effic = 0; land->lnd_effic = 0;
land->lnd_own = (natid)0; land->lnd_own = (natid)0;
} }

View file

@ -139,8 +139,8 @@ fuel(void)
if (sect.sct_effic < 2) { if (sect.sct_effic < 2) {
pr("The harbor at %s is not 2%% efficient yet.\n", pr("The harbor at %s is not 2%% efficient yet.\n",
xyas(item.ship.shp_x, xyas(item.ship.shp_x, item.ship.shp_y,
item.ship.shp_y, player->cnum)); player->cnum));
harbor = 0; harbor = 0;
} }
if ((sect.sct_own != player->cnum) && sect.sct_own) if ((sect.sct_own != player->cnum) && sect.sct_own)

View file

@ -159,8 +159,8 @@ laun(void)
if (retval != RET_OK) if (retval != RET_OK)
return retval; return retval;
if (gone) { if (gone) {
makelost(EF_PLANE, plane.pln_own, plane.pln_uid, plane.pln_x, makelost(EF_PLANE, plane.pln_own, plane.pln_uid,
plane.pln_y); plane.pln_x, plane.pln_y);
plane.pln_own = 0; plane.pln_own = 0;
putplane(plane.pln_uid, &plane); putplane(plane.pln_uid, &plane);
} }

View file

@ -460,11 +460,11 @@ load_plane_ship(struct sctstr *sectp, struct shpstr *sp, int noisy,
sprintf(buf, "loaded on your %s at %s", sprintf(buf, "loaded on your %s at %s",
prship(sp), xyas(sp->shp_x, sp->shp_y, sp->shp_own)); prship(sp), xyas(sp->shp_x, sp->shp_y, sp->shp_own));
gift(sp->shp_own, player->cnum, &pln, EF_PLANE, buf); gift(sp->shp_own, player->cnum, &pln, EF_PLANE, buf);
makelost(EF_PLANE, pln.pln_own, pln.pln_uid, pln.pln_x, makelost(EF_PLANE, pln.pln_own, pln.pln_uid,
pln.pln_y); pln.pln_x, pln.pln_y);
pln.pln_own = sp->shp_own; pln.pln_own = sp->shp_own;
makenotlost(EF_PLANE, pln.pln_own, pln.pln_uid, pln.pln_x, makenotlost(EF_PLANE, pln.pln_own, pln.pln_uid,
pln.pln_y); pln.pln_x, pln.pln_y);
pln.pln_mission = 0; pln.pln_mission = 0;
putplane(pln.pln_uid, &pln); putplane(pln.pln_uid, &pln);
} else { } else {
@ -478,11 +478,11 @@ load_plane_ship(struct sctstr *sectp, struct shpstr *sp, int noisy,
dchr[sectp->sct_type].d_name, dchr[sectp->sct_type].d_name,
xyas(sectp->sct_x, sectp->sct_y, sectp->sct_own)); xyas(sectp->sct_x, sectp->sct_y, sectp->sct_own));
gift(sectp->sct_own, player->cnum, &pln, EF_PLANE, buf); gift(sectp->sct_own, player->cnum, &pln, EF_PLANE, buf);
makelost(EF_PLANE, pln.pln_own, pln.pln_uid, pln.pln_x, makelost(EF_PLANE, pln.pln_own, pln.pln_uid,
pln.pln_y); pln.pln_x, pln.pln_y);
pln.pln_own = sectp->sct_own; pln.pln_own = sectp->sct_own;
makenotlost(EF_PLANE, pln.pln_own, pln.pln_uid, pln.pln_x, makenotlost(EF_PLANE, pln.pln_own, pln.pln_uid,
pln.pln_y); pln.pln_x, pln.pln_y);
putplane(pln.pln_uid, &pln); putplane(pln.pln_uid, &pln);
} }
pr("%s %s %s at %s.\n", pr("%s %s %s at %s.\n",
@ -631,11 +631,11 @@ load_land_ship(struct sctstr *sectp, struct shpstr *sp, int noisy,
sprintf(buf, "loaded on your %s at %s", sprintf(buf, "loaded on your %s at %s",
prship(sp), xyas(sp->shp_x, sp->shp_y, sp->shp_own)); prship(sp), xyas(sp->shp_x, sp->shp_y, sp->shp_own));
gift(sp->shp_own, player->cnum, &land, EF_LAND, buf); gift(sp->shp_own, player->cnum, &land, EF_LAND, buf);
makelost(EF_LAND, land.lnd_own, land.lnd_uid, land.lnd_x, makelost(EF_LAND, land.lnd_own, land.lnd_uid,
land.lnd_y); land.lnd_x, land.lnd_y);
land.lnd_own = sp->shp_own; land.lnd_own = sp->shp_own;
makenotlost(EF_LAND, land.lnd_own, land.lnd_uid, land.lnd_x, makenotlost(EF_LAND, land.lnd_own, land.lnd_uid,
land.lnd_y); land.lnd_x, land.lnd_y);
land.lnd_ship = sp->shp_uid; land.lnd_ship = sp->shp_uid;
land.lnd_harden = 0; land.lnd_harden = 0;
land.lnd_mission = 0; land.lnd_mission = 0;
@ -875,11 +875,11 @@ load_plane_land(struct sctstr *sectp, struct lndstr *lp, int noisy,
sprintf(buf, "loaded on %s at %s", sprintf(buf, "loaded on %s at %s",
prland(lp), xyas(lp->lnd_x, lp->lnd_y, lp->lnd_own)); prland(lp), xyas(lp->lnd_x, lp->lnd_y, lp->lnd_own));
gift(lp->lnd_own, player->cnum, &pln, EF_PLANE, buf); gift(lp->lnd_own, player->cnum, &pln, EF_PLANE, buf);
makelost(EF_PLANE, pln.pln_own, pln.pln_uid, pln.pln_x, makelost(EF_PLANE, pln.pln_own, pln.pln_uid,
pln.pln_y); pln.pln_x, pln.pln_y);
pln.pln_own = lp->lnd_own; pln.pln_own = lp->lnd_own;
makenotlost(EF_PLANE, pln.pln_own, pln.pln_uid, pln.pln_x, makenotlost(EF_PLANE, pln.pln_own, pln.pln_uid,
pln.pln_y); pln.pln_x, pln.pln_y);
putplane(pln.pln_uid, &pln); putplane(pln.pln_uid, &pln);
} else { } else {
if (!take_plane_off_land(&pln, lp)) { if (!take_plane_off_land(&pln, lp)) {
@ -891,11 +891,11 @@ load_plane_land(struct sctstr *sectp, struct lndstr *lp, int noisy,
sprintf(buf, "unloaded at your sector at %s", sprintf(buf, "unloaded at your sector at %s",
xyas(sectp->sct_x, sectp->sct_y, sectp->sct_own)); xyas(sectp->sct_x, sectp->sct_y, sectp->sct_own));
gift(sectp->sct_own, player->cnum, &pln, EF_PLANE, buf); gift(sectp->sct_own, player->cnum, &pln, EF_PLANE, buf);
makelost(EF_PLANE, pln.pln_own, pln.pln_uid, pln.pln_x, makelost(EF_PLANE, pln.pln_own, pln.pln_uid,
pln.pln_y); pln.pln_x, pln.pln_y);
pln.pln_own = sectp->sct_own; pln.pln_own = sectp->sct_own;
makenotlost(EF_PLANE, pln.pln_own, pln.pln_uid, pln.pln_x, makenotlost(EF_PLANE, pln.pln_own, pln.pln_uid,
pln.pln_y); pln.pln_x, pln.pln_y);
putplane(pln.pln_uid, &pln); putplane(pln.pln_uid, &pln);
} }
pr("%s %s %s at %s.\n", pr("%s %s %s at %s.\n",
@ -1090,11 +1090,11 @@ load_land_land(struct sctstr *sectp, struct lndstr *lp, int noisy,
sprintf(buf, "loaded on your %s at %s", sprintf(buf, "loaded on your %s at %s",
prland(lp), xyas(lp->lnd_x, lp->lnd_y, lp->lnd_own)); prland(lp), xyas(lp->lnd_x, lp->lnd_y, lp->lnd_own));
gift(lp->lnd_own, player->cnum, &land, EF_LAND, buf); gift(lp->lnd_own, player->cnum, &land, EF_LAND, buf);
makelost(EF_LAND, land.lnd_own, land.lnd_uid, land.lnd_x, makelost(EF_LAND, land.lnd_own, land.lnd_uid,
land.lnd_y); land.lnd_x, land.lnd_y);
land.lnd_own = lp->lnd_own; land.lnd_own = lp->lnd_own;
makenotlost(EF_LAND, land.lnd_own, land.lnd_uid, land.lnd_x, makenotlost(EF_LAND, land.lnd_own, land.lnd_uid,
land.lnd_y); land.lnd_x, land.lnd_y);
land.lnd_land = lp->lnd_uid; land.lnd_land = lp->lnd_uid;
land.lnd_harden = 0; land.lnd_harden = 0;
land.lnd_mission = 0; land.lnd_mission = 0;
@ -1125,11 +1125,11 @@ load_land_land(struct sctstr *sectp, struct lndstr *lp, int noisy,
dchr[sectp->sct_type].d_name, dchr[sectp->sct_type].d_name,
xyas(sectp->sct_x, sectp->sct_y, sectp->sct_own)); xyas(sectp->sct_x, sectp->sct_y, sectp->sct_own));
gift(sectp->sct_own, player->cnum, &land, EF_LAND, buf); gift(sectp->sct_own, player->cnum, &land, EF_LAND, buf);
makelost(EF_LAND, land.lnd_own, land.lnd_uid, land.lnd_x, makelost(EF_LAND, land.lnd_own, land.lnd_uid,
land.lnd_y); land.lnd_x, land.lnd_y);
land.lnd_own = sectp->sct_own; land.lnd_own = sectp->sct_own;
makenotlost(EF_LAND, land.lnd_own, land.lnd_uid, land.lnd_x, makenotlost(EF_LAND, land.lnd_own, land.lnd_uid,
land.lnd_y); land.lnd_x, land.lnd_y);
land.lnd_land = -1; land.lnd_land = -1;
lp->lnd_nland--; lp->lnd_nland--;
putland(land.lnd_uid, &land); putland(land.lnd_uid, &land);

View file

@ -334,8 +334,9 @@ multifire(void)
} }
shell = fship.shp_item[I_SHELL]; shell = fship.shp_item[I_SHELL];
if (shell < 2) if (shell < 2)
shell += supply_commod(fship.shp_own, fship.shp_x, shell += supply_commod(fship.shp_own,
fship.shp_y, I_SHELL, 2 - shell); fship.shp_x, fship.shp_y,
I_SHELL, 2 - shell);
if (shell <= 0) { if (shell <= 0) {
pr("Klick! ...\n"); pr("Klick! ...\n");
continue; continue;
@ -426,8 +427,8 @@ multifire(void)
fy = fsect.sct_y; fy = fsect.sct_y;
if (fsect.sct_own != player->cnum || if (fsect.sct_own != player->cnum ||
fsect.sct_type != SCT_FORTR) { fsect.sct_type != SCT_FORTR) {
pr("No fortress at %s\n", xyas(fsect.sct_x, pr("No fortress at %s\n",
fsect.sct_y, player->cnum)); xyas(fsect.sct_x, fsect.sct_y, player->cnum));
continue; continue;
} }
if (target == targ_land) { if (target == targ_land) {
@ -444,8 +445,9 @@ multifire(void)
} }
shell = fsect.sct_item[I_SHELL]; shell = fsect.sct_item[I_SHELL];
if (shell <= 0) if (shell <= 0)
shell += supply_commod(fsect.sct_own, fsect.sct_x, shell += supply_commod(fsect.sct_own,
fsect.sct_y, I_SHELL, 1); fsect.sct_x, fsect.sct_y,
I_SHELL, 1);
if (shell <= 0) { if (shell <= 0) {
pr("Klick! ...\n"); pr("Klick! ...\n");
continue; continue;
@ -793,7 +795,8 @@ quiet_bigdef(int attacker, struct emp_qelem *list, natid own, natid aown,
if (mchr[(int)ship.shp_type].m_flags & M_SUB) { if (mchr[(int)ship.shp_type].m_flags & M_SUB) {
if (shell < SHP_TORP_SHELLS) if (shell < SHP_TORP_SHELLS)
shell += supply_commod(ship.shp_own, ship.shp_x, ship.shp_y, shell += supply_commod(ship.shp_own,
ship.shp_x, ship.shp_y,
I_SHELL, SHP_TORP_SHELLS - shell); I_SHELL, SHP_TORP_SHELLS - shell);
if (shell < SHP_TORP_SHELLS) if (shell < SHP_TORP_SHELLS)
continue; continue;
@ -834,8 +837,8 @@ quiet_bigdef(int attacker, struct emp_qelem *list, natid own, natid aown,
continue; continue;
/* must have gun, shell, and milit to fire */ /* must have gun, shell, and milit to fire */
if (shell < 1) if (shell < 1)
shell += supply_commod(ship.shp_own, ship.shp_x, ship.shp_y, shell += supply_commod(ship.shp_own,
I_SHELL, 1); ship.shp_x, ship.shp_y, I_SHELL, 1);
/* only need 1 shell, so don't check that */ /* only need 1 shell, so don't check that */
if (shell < 1) if (shell < 1)
continue; continue;

View file

@ -50,20 +50,19 @@
#include "optlist.h" #include "optlist.h"
/* /*
** Command syntax: * Command syntax:
** *
** ORDER <ship> Show orders * ORDER <ship> Show orders
** ORDER <ship> c[ancel] Cancel orders * ORDER <ship> c[ancel] Cancel orders
** ORDER <ship> s[top] Suspend orders * ORDER <ship> s[top] Suspend orders
** ORDER <ship> r[esume] Resume orders * ORDER <ship> r[esume] Resume orders
** ORDER <ship> d[eclare] <dest1> Set destination * ORDER <ship> d[eclare] <dest1> Set destination
** d[eclare] <dest1> <dest2> * d[eclare] <dest1> <dest2>
** ORDER <ship> l[evel] <field> <start/end> <comm> <level> * ORDER <ship> l[evel] <field> <start/end> <comm> <level>
** *
** * New syntax:
** New syntax: * qorder <ship> display cargo levels
** qorder <ship> display cargo levels * sorder <ship> display statistical info
** sorder <ship> display statistical info
*/ */
int int
@ -471,9 +470,9 @@ sorde(void)
else { else {
/* ETA calculation */ /* ETA calculation */
c = BestShipPath(buf, ship.shp_x, c = BestShipPath(buf, ship.shp_x, ship.shp_y,
ship.shp_y, ship.shp_destx[0], ship.shp_destx[0], ship.shp_desty[0],
ship.shp_desty[0], ship.shp_own); ship.shp_own);
if (!c) if (!c)
pr(" no route possible"); pr(" no route possible");
else if (*c == 'h') else if (*c == 'h')

View file

@ -157,10 +157,9 @@ setsector(void)
wu(player->cnum, amt, wu(player->cnum, amt,
"Sector %s gained from deity intervention\n", "Sector %s gained from deity intervention\n",
xyas(sect.sct_x, sect.sct_y, amt)); xyas(sect.sct_x, sect.sct_y, amt));
makelost(EF_SECTOR, sect.sct_own, 0, sect.sct_x, makelost(EF_SECTOR, sect.sct_own, 0,
sect.sct_y); sect.sct_x, sect.sct_y);
makenotlost(EF_SECTOR, amt, 0, sect.sct_x, sect.sct_y); makenotlost(EF_SECTOR, amt, 0, sect.sct_x, sect.sct_y);
sect.sct_own = (natid)amt; sect.sct_own = (natid)amt;
putsect(&sect); putsect(&sect);
} }

View file

@ -261,8 +261,8 @@ plane_sona(struct emp_qelem *plane_list, int x, int y,
tmcp = &mchr[(int)targ->shp_type]; tmcp = &mchr[(int)targ->shp_type];
if (!(tmcp->m_flags & M_SUB)) if (!(tmcp->m_flags & M_SUB))
continue; continue;
if (roll(100) > if (roll(100) > pln_identchance(pp, shp_hardtarget(targ),
pln_identchance(pp, shp_hardtarget(targ), EF_SHIP)) EF_SHIP))
continue; continue;
pingrange = MAX(targ->shp_visib, 10) * range / 10; pingrange = MAX(targ->shp_visib, 10) * range / 10;
vrange = pingrange * (pp->pln_effic / 200.0); vrange = pingrange * (pp->pln_effic / 200.0);
@ -289,8 +289,8 @@ plane_sona(struct emp_qelem *plane_list, int x, int y,
if (getrel(getnatp(targ->shp_own), pp->pln_own) < FRIENDLY && if (getrel(getnatp(targ->shp_own), pp->pln_own) < FRIENDLY &&
roll(100) > pln_identchance(pp, shp_hardtarget(targ), roll(100) > pln_identchance(pp, shp_hardtarget(targ),
EF_SHIP)) EF_SHIP))
if (roll(100) > if (roll(100) > pln_identchance(pp, shp_hardtarget(targ),
pln_identchance(pp, shp_hardtarget(targ), EF_SHIP)) EF_SHIP))
mpr(pp->pln_own, "sub #%d %s\n", targ->shp_uid, mpr(pp->pln_own, "sub #%d %s\n", targ->shp_uid,
xyas(targ->shp_x, targ->shp_y, pp->pln_own)); xyas(targ->shp_x, targ->shp_y, pp->pln_own));
else else

View file

@ -180,8 +180,7 @@ spy(void)
} else { } else {
insert(table, &t_len, nx, ny); insert(table, &t_len, nx, ny);
spyline(&dsect); spyline(&dsect);
changed += map_set(player->cnum, dsect.sct_x, changed += map_set(player->cnum, dsect.sct_x, dsect.sct_y,
dsect.sct_y,
dchr[dsect.sct_type].d_mnem, 0); dchr[dsect.sct_type].d_mnem, 0);
prunits(dsect.sct_x, dsect.sct_y); prunits(dsect.sct_x, dsect.sct_y);
prplanes(dsect.sct_x, dsect.sct_y); prplanes(dsect.sct_x, dsect.sct_y);
@ -195,8 +194,7 @@ spy(void)
if (nrecon && caught) { if (nrecon && caught) {
insert(table, &t_len, nx, ny); insert(table, &t_len, nx, ny);
spyline(&dsect); spyline(&dsect);
changed += map_set(player->cnum, dsect.sct_x, changed += map_set(player->cnum, dsect.sct_x, dsect.sct_y,
dsect.sct_y,
dchr[dsect.sct_type].d_mnem, 0); dchr[dsect.sct_type].d_mnem, 0);
prunits(dsect.sct_x, dsect.sct_y); prunits(dsect.sct_x, dsect.sct_y);
prplanes(dsect.sct_x, dsect.sct_y); prplanes(dsect.sct_x, dsect.sct_y);

View file

@ -272,11 +272,11 @@ tend_land(struct shpstr *tenderp, char *units)
prship(&target), xyas(target.shp_x, target.shp_y, prship(&target), xyas(target.shp_x, target.shp_y,
target.shp_own)); target.shp_own));
gift(target.shp_own, player->cnum, &land, EF_LAND, buf); gift(target.shp_own, player->cnum, &land, EF_LAND, buf);
makelost(EF_LAND, land.lnd_own, land.lnd_uid, land.lnd_x, makelost(EF_LAND, land.lnd_own, land.lnd_uid,
land.lnd_y); land.lnd_x, land.lnd_y);
land.lnd_own = target.shp_own; land.lnd_own = target.shp_own;
makenotlost(EF_LAND, land.lnd_own, land.lnd_uid, land.lnd_x, makenotlost(EF_LAND, land.lnd_own, land.lnd_uid,
land.lnd_y); land.lnd_x, land.lnd_y);
land.lnd_ship = target.shp_uid; land.lnd_ship = target.shp_uid;
land.lnd_harden = 0; land.lnd_harden = 0;
land.lnd_mission = 0; land.lnd_mission = 0;

View file

@ -352,9 +352,8 @@ fire_dchrg(struct shpstr *sp, struct shpstr *targ, int ntargets)
gun = MIN(gun, sp->shp_glim); gun = MIN(gun, sp->shp_glim);
gun = MIN(gun, sp->shp_item[I_MILIT] / 2); gun = MIN(gun, sp->shp_item[I_MILIT] / 2);
shells += shells += supply_commod(sp->shp_own, sp->shp_x, sp->shp_y,
supply_commod(sp->shp_own, sp->shp_x, sp->shp_y, I_SHELL, I_SHELL, (gun + 1) / 2 - shells);
(gun + 1) / 2 - shells);
gun = MIN(gun, shells * 2); gun = MIN(gun, shells * 2);
if (gun == 0) if (gun == 0)
@ -403,8 +402,8 @@ fire_torp(struct shpstr *sp, struct shpstr *targ, int range, int ntargets)
shells = sp->shp_item[I_SHELL]; shells = sp->shp_item[I_SHELL];
if (shells < SHP_TORP_SHELLS) if (shells < SHP_TORP_SHELLS)
shells += supply_commod(sp->shp_own, sp->shp_x, sp->shp_y, I_SHELL, shells += supply_commod(sp->shp_own, sp->shp_x, sp->shp_y,
SHP_TORP_SHELLS - shells); I_SHELL, SHP_TORP_SHELLS - shells);
if (sp->shp_item[I_GUN] == 0 || shells < SHP_TORP_SHELLS) if (sp->shp_item[I_GUN] == 0 || shells < SHP_TORP_SHELLS)
return 0; return 0;

View file

@ -389,8 +389,8 @@ check_trade(void)
case EF_NUKE: case EF_NUKE:
tg.nuk.nuk_x = trade.trd_x; tg.nuk.nuk_x = trade.trd_x;
tg.nuk.nuk_y = trade.trd_y; tg.nuk.nuk_y = trade.trd_y;
makelost(EF_NUKE, tg.nuk.nuk_own, tg.nuk.nuk_uid, tg.nuk.nuk_x, makelost(EF_NUKE, tg.nuk.nuk_own, tg.nuk.nuk_uid,
tg.nuk.nuk_y); tg.nuk.nuk_x, tg.nuk.nuk_y);
tg.nuk.nuk_own = trade.trd_maxbidder; tg.nuk.nuk_own = trade.trd_maxbidder;
makenotlost(EF_NUKE, tg.nuk.nuk_own, tg.nuk.nuk_uid, makenotlost(EF_NUKE, tg.nuk.nuk_own, tg.nuk.nuk_uid,
tg.nuk.nuk_x, tg.nuk.nuk_y); tg.nuk.nuk_x, tg.nuk.nuk_y);
@ -430,8 +430,8 @@ check_trade(void)
ship.shp_nland--; ship.shp_nland--;
putship(ship.shp_uid, &ship); putship(ship.shp_uid, &ship);
} }
makelost(EF_LAND, tg.lnd.lnd_own, tg.lnd.lnd_uid, tg.lnd.lnd_x, makelost(EF_LAND, tg.lnd.lnd_own, tg.lnd.lnd_uid,
tg.lnd.lnd_y); tg.lnd.lnd_x, tg.lnd.lnd_y);
tg.lnd.lnd_own = trade.trd_maxbidder; tg.lnd.lnd_own = trade.trd_maxbidder;
makenotlost(EF_LAND, tg.lnd.lnd_own, tg.lnd.lnd_uid, makenotlost(EF_LAND, tg.lnd.lnd_own, tg.lnd.lnd_uid,
tg.lnd.lnd_x, tg.lnd.lnd_y); tg.lnd.lnd_x, tg.lnd.lnd_y);

View file

@ -133,8 +133,8 @@ vers(void)
} }
pr("\n"); pr("\n");
pr("\t\t\t\tSectors\tShips\tPlanes\tUnits\n"); pr("\t\t\t\tSectors\tShips\tPlanes\tUnits\n");
pr("Maximum mobility\t\t%d\t%d\t%d\t%d\n", sect_mob_max, pr("Maximum mobility\t\t%d\t%d\t%d\t%d\n",
ship_mob_max, plane_mob_max, land_mob_max); sect_mob_max, ship_mob_max, plane_mob_max, land_mob_max);
pr("Max mob gain per update\t\t%d\t%d\t%d\t%d\n", pr("Max mob gain per update\t\t%d\t%d\t%d\t%d\n",
(int)(sect_mob_scale * (float)etu_per_update), (int)(sect_mob_scale * (float)etu_per_update),
(int)(ship_mob_scale * (float)etu_per_update), (int)(ship_mob_scale * (float)etu_per_update),

View file

@ -126,8 +126,8 @@ knockdown(struct sctstr *sp, struct emp_qelem *list)
mpr(land.lnd_own, "\07"); mpr(land.lnd_own, "\07");
mpr(land.lnd_own, " AARGH! %s tumbles to its doom!\n", mpr(land.lnd_own, " AARGH! %s tumbles to its doom!\n",
prland(&land)); prland(&land));
makelost(EF_LAND, land.lnd_own, land.lnd_uid, land.lnd_x, makelost(EF_LAND, land.lnd_own, land.lnd_uid,
land.lnd_y); land.lnd_x, land.lnd_y);
land.lnd_own = 0; land.lnd_own = 0;
land.lnd_effic = 0; land.lnd_effic = 0;
putland(land.lnd_uid, &land); putland(land.lnd_uid, &land);
@ -149,8 +149,8 @@ knockdown(struct sctstr *sp, struct emp_qelem *list)
mpr(plane.pln_own, "\07"); mpr(plane.pln_own, "\07");
mpr(plane.pln_own, " AARGH! %s tumbles to its doom!\n", mpr(plane.pln_own, " AARGH! %s tumbles to its doom!\n",
prplane(&plane)); prplane(&plane));
makelost(EF_PLANE, plane.pln_own, plane.pln_uid, plane.pln_x, makelost(EF_PLANE, plane.pln_own, plane.pln_uid,
plane.pln_y); plane.pln_x, plane.pln_y);
plane.pln_own = 0; plane.pln_own = 0;
plane.pln_effic = 0; plane.pln_effic = 0;
putplane(plane.pln_uid, &plane); putplane(plane.pln_uid, &plane);
@ -167,8 +167,8 @@ knockdown(struct sctstr *sp, struct emp_qelem *list)
mpr(nuke.nuk_own, "\07"); mpr(nuke.nuk_own, "\07");
mpr(nuke.nuk_own, " %s sinks to the bottom of the sea!\n", mpr(nuke.nuk_own, " %s sinks to the bottom of the sea!\n",
prnuke(&nuke)); prnuke(&nuke));
makelost(EF_NUKE, nuke.nuk_own, nuke.nuk_uid, nuke.nuk_x, makelost(EF_NUKE, nuke.nuk_own, nuke.nuk_uid,
nuke.nuk_y); nuke.nuk_x, nuke.nuk_y);
nuke.nuk_own = 0; nuke.nuk_own = 0;
nuke.nuk_effic = 0; nuke.nuk_effic = 0;
putnuke(nuke.nuk_uid, &nuke); putnuke(nuke.nuk_uid, &nuke);

View file

@ -183,8 +183,8 @@ ac_encounter(struct emp_qelem *bomb_list, struct emp_qelem *esc_list,
} else { } else {
PR(plane_owner, "flying over %s at %s\n", PR(plane_owner, "flying over %s at %s\n",
dchr[sect.sct_type].d_name, xyas(x, y, plane_owner)); dchr[sect.sct_type].d_name, xyas(x, y, plane_owner));
changed += map_set(plane_owner, sect.sct_x, changed += map_set(plane_owner, sect.sct_x, sect.sct_y,
sect.sct_y, dchr[sect.sct_type].d_mnem, 0); dchr[sect.sct_type].d_mnem, 0);
} }
if ((rel = getrel(over, plane_owner)) == ALLIED) if ((rel = getrel(over, plane_owner)) == ALLIED)
continue; continue;
@ -310,8 +310,8 @@ ac_encounter(struct emp_qelem *bomb_list, struct emp_qelem *esc_list,
/* Flag that we intercepted */ /* Flag that we intercepted */
intown = 1; intown = 1;
/* And now intercept again */ /* And now intercept again */
ac_intercept(bomb_list, esc_list, &ilist[cn], cn, x, ac_intercept(bomb_list, esc_list, &ilist[cn],
y); cn, x, y);
} }
} }
} }
@ -336,8 +336,8 @@ ac_encounter(struct emp_qelem *bomb_list, struct emp_qelem *esc_list,
if (!evaded) { if (!evaded) {
if (intown == -1) { if (intown == -1) {
/* We haven't intercepted yet, so intercept */ /* We haven't intercepted yet, so intercept */
ac_intercept(bomb_list, esc_list, &ilist[cn], cn, ac_intercept(bomb_list, esc_list, &ilist[cn],
x, y); cn, x, y);
} }
} }
} }
@ -837,8 +837,8 @@ ac_shipflak(struct emp_qelem *list, coord x, coord y)
if (gun) { if (gun) {
shell = ship.shp_item[I_SHELL]; shell = ship.shp_item[I_SHELL];
if (shell <= 0) { if (shell <= 0) {
shell = supply_commod(ship.shp_own, ship.shp_x, shell = supply_commod(ship.shp_own, ship.shp_x, ship.shp_y,
ship.shp_y, I_SHELL, 1); I_SHELL, 1);
ship.shp_item[I_SHELL] = shell; ship.shp_item[I_SHELL] = shell;
putship(ship.shp_uid, &ship); putship(ship.shp_uid, &ship);
} }

View file

@ -384,11 +384,11 @@ put_combat(struct combat *com)
else else
land.lnd_mobil = (signed char)(com->mob - com->mobcost); land.lnd_mobil = (signed char)(com->mob - com->mobcost);
} }
makelost(EF_LAND, land.lnd_own, land.lnd_uid, land.lnd_x, makelost(EF_LAND, land.lnd_own, land.lnd_uid,
land.lnd_y); land.lnd_x, land.lnd_y);
land.lnd_own = com->own; land.lnd_own = com->own;
makenotlost(EF_LAND, land.lnd_own, land.lnd_uid, land.lnd_x, makenotlost(EF_LAND, land.lnd_own, land.lnd_uid,
land.lnd_y); land.lnd_x, land.lnd_y);
if (com->plague) { if (com->plague) {
if (land.lnd_pstage == PLG_HEALTHY) if (land.lnd_pstage == PLG_HEALTHY)
land.lnd_pstage = PLG_EXPOSED; land.lnd_pstage = PLG_EXPOSED;
@ -412,11 +412,11 @@ put_combat(struct combat *com)
else else
ship.shp_mobil = (signed char)(com->mob - com->mobcost); ship.shp_mobil = (signed char)(com->mob - com->mobcost);
} }
makelost(EF_SHIP, ship.shp_own, ship.shp_uid, ship.shp_x, makelost(EF_SHIP, ship.shp_own, ship.shp_uid,
ship.shp_y); ship.shp_x, ship.shp_y);
ship.shp_own = com->own; ship.shp_own = com->own;
makenotlost(EF_SHIP, ship.shp_own, ship.shp_uid, ship.shp_x, makenotlost(EF_SHIP, ship.shp_own, ship.shp_uid,
ship.shp_y); ship.shp_x, ship.shp_y);
if (com->plague) { if (com->plague) {
if (ship.shp_pstage == PLG_HEALTHY) if (ship.shp_pstage == PLG_HEALTHY)
ship.shp_pstage = PLG_EXPOSED; ship.shp_pstage = PLG_EXPOSED;

View file

@ -301,8 +301,8 @@ detonate(struct nukstr *np, coord x, coord y, int airburst)
continue; continue;
if (roll(100) >= damage) if (roll(100) >= damage)
continue; continue;
makelost(EF_NUKE, nuke.nuk_own, nuke.nuk_uid, nuke.nuk_x, makelost(EF_NUKE, nuke.nuk_own, nuke.nuk_uid,
nuke.nuk_y); nuke.nuk_x, nuke.nuk_y);
nuke.nuk_own = 0; nuke.nuk_own = 0;
if (own == bombown) { if (own == bombown) {
mpr(bombown, "%s at %s destroyed\n", mpr(bombown, "%s at %s destroyed\n",

View file

@ -137,10 +137,8 @@ sd(natid att, natid own, coord x, coord y, int noisy, int defending,
else else
wu(0, ship.shp_own, wu(0, ship.shp_own,
"%s supported %s attacks against %s at %s, doing %d damage.\n", "%s supported %s attacks against %s at %s, doing %d damage.\n",
prship(&ship), cname(own), cname(att), xyas(x, y, prship(&ship), cname(own), cname(att),
ship. xyas(x, y, ship.shp_own), dam);
shp_own),
dam);
} }
} }
} }
@ -233,8 +231,8 @@ sb(natid att, natid def, struct sctstr *sp, coord tx, coord ty, int noisy,
return 0; return 0;
shell = sp->sct_item[I_SHELL]; shell = sp->sct_item[I_SHELL];
if (shell <= 0) if (shell <= 0)
shell += supply_commod(sp->sct_own, sp->sct_x, sp->sct_y, I_SHELL, shell += supply_commod(sp->sct_own, sp->sct_x, sp->sct_y,
1); I_SHELL, 1);
if (shell <= 0) if (shell <= 0)
return 0; return 0;
sp->sct_item[I_SHELL] = shell - 1; sp->sct_item[I_SHELL] = shell - 1;
@ -243,11 +241,8 @@ sb(natid att, natid def, struct sctstr *sp, coord tx, coord ty, int noisy,
if (sp->sct_own != def) if (sp->sct_own != def)
wu(0, sp->sct_own, wu(0, sp->sct_own,
"%s fired on %s in %s in defense of %s, doing %d damage!\n", "%s fired on %s in %s in defense of %s, doing %d damage!\n",
xyas(sp->sct_x, sp->sct_y, sp->sct_own), cname(att), xyas(tx, xyas(sp->sct_x, sp->sct_y, sp->sct_own), cname(att),
ty, xyas(tx, ty, sp->sct_own), cname(def), damage);
sp->
sct_own),
cname(def), damage);
if (defending) if (defending)
nreport(sp->sct_own, N_FIRE_BACK, att, 1); nreport(sp->sct_own, N_FIRE_BACK, att, 1);
else else

View file

@ -123,8 +123,8 @@ lnd_prewrite(int n, void *ptr)
time(&llp->lnd_timestamp); time(&llp->lnd_timestamp);
if (llp->lnd_own && llp->lnd_effic < LAND_MINEFF) { if (llp->lnd_own && llp->lnd_effic < LAND_MINEFF) {
makelost(EF_LAND, llp->lnd_own, llp->lnd_uid, llp->lnd_x, makelost(EF_LAND, llp->lnd_own, llp->lnd_uid,
llp->lnd_y); llp->lnd_x, llp->lnd_y);
llp->lnd_own = 0; llp->lnd_own = 0;
getland(n, &land); getland(n, &land);
@ -132,8 +132,8 @@ lnd_prewrite(int n, void *ptr)
for (i = 0; NULL != (lp = getlandp(i)); i++) { for (i = 0; NULL != (lp = getlandp(i)); i++) {
if (lp->lnd_own && lp->lnd_land == n) { if (lp->lnd_own && lp->lnd_land == n) {
mpr(lp->lnd_own, "%s MIA!\n", prland(lp)); mpr(lp->lnd_own, "%s MIA!\n", prland(lp));
makelost(EF_LAND, lp->lnd_own, lp->lnd_uid, lp->lnd_x, makelost(EF_LAND, lp->lnd_own, lp->lnd_uid,
lp->lnd_y); lp->lnd_x, lp->lnd_y);
lp->lnd_own = 0; lp->lnd_own = 0;
lp->lnd_effic = 0; lp->lnd_effic = 0;
lp->lnd_ship = -1; lp->lnd_ship = -1;
@ -144,8 +144,8 @@ lnd_prewrite(int n, void *ptr)
for (i = 0; NULL != (pp = getplanep(i)); i++) { for (i = 0; NULL != (pp = getplanep(i)); i++) {
if (pp->pln_own && pp->pln_land == n) { if (pp->pln_own && pp->pln_land == n) {
mpr(pp->pln_own, "%s MIA!\n", prplane(pp)); mpr(pp->pln_own, "%s MIA!\n", prplane(pp));
makelost(EF_PLANE, pp->pln_own, pp->pln_uid, pp->pln_x, makelost(EF_PLANE, pp->pln_own, pp->pln_uid,
pp->pln_y); pp->pln_x, pp->pln_y);
pp->pln_own = 0; pp->pln_own = 0;
pp->pln_effic = 0; pp->pln_effic = 0;
pp->pln_ship = -1; pp->pln_ship = -1;

View file

@ -951,8 +951,8 @@ lnd_fort_interdiction(struct emp_qelem *list,
continue; continue;
shell = fsect.sct_item[I_SHELL]; shell = fsect.sct_item[I_SHELL];
if (shell < 1) if (shell < 1)
shell += supply_commod(fsect.sct_own, shell += supply_commod(fsect.sct_own, fsect.sct_x, fsect.sct_y,
fsect.sct_x, fsect.sct_y, I_SHELL, 1); I_SHELL, 1);
if (shell < 1) if (shell < 1)
continue; continue;
shell--; shell--;

View file

@ -1459,8 +1459,8 @@ air_damage(struct emp_qelem *bombers, coord x, coord y, int mission,
/* use up missiles */ /* use up missiles */
if (plp->pcp->pl_flags & P_M) { if (plp->pcp->pl_flags & P_M) {
makelost(EF_PLANE, pp->pln_own, pp->pln_uid, pp->pln_x, makelost(EF_PLANE, pp->pln_own, pp->pln_uid,
pp->pln_y); pp->pln_x, pp->pln_y);
pp->pln_own = 0; pp->pln_own = 0;
} }
} }

View file

@ -116,8 +116,8 @@ pln_prewrite(int n, void *ptr)
if (pp->pln_effic < PLANE_MINEFF) { if (pp->pln_effic < PLANE_MINEFF) {
if (pp->pln_own) if (pp->pln_own)
makelost(EF_PLANE, pp->pln_own, pp->pln_uid, pp->pln_x, makelost(EF_PLANE, pp->pln_own, pp->pln_uid,
pp->pln_y); pp->pln_x, pp->pln_y);
pp->pln_own = 0; pp->pln_own = 0;
pp->pln_effic = 0; pp->pln_effic = 0;
for (i = 0; NULL != (np = getnukep(i)); i++) { for (i = 0; NULL != (np = getnukep(i)); i++) {

View file

@ -727,9 +727,8 @@ pln_equip(struct plist *plp, struct ichrstr *ip, int flags, char mission)
} else { } else {
if (pp->pln_own != sect.sct_own) { if (pp->pln_own != sect.sct_own) {
wu(0, sect.sct_own, "%s %s prepares for takeoff from %s\n", wu(0, sect.sct_own, "%s %s prepares for takeoff from %s\n",
cname(pp->pln_own), prplane(pp), xyas(sect.sct_x, cname(pp->pln_own), prplane(pp),
sect.sct_y, xyas(sect.sct_x, sect.sct_y, sect.sct_own));
sect.sct_own));
} }
putsect(&sect); putsect(&sect);
} }

View file

@ -85,8 +85,8 @@ shp_prewrite(int n, void *ptr)
for (i = 0; NULL != (lp = getlandp(i)); i++) { for (i = 0; NULL != (lp = getlandp(i)); i++) {
if (lp->lnd_own && lp->lnd_ship == n) { if (lp->lnd_own && lp->lnd_ship == n) {
mpr(lp->lnd_own, "%s sunk!\n", prland(lp)); mpr(lp->lnd_own, "%s sunk!\n", prland(lp));
makelost(EF_LAND, lp->lnd_own, lp->lnd_uid, lp->lnd_x, makelost(EF_LAND, lp->lnd_own, lp->lnd_uid,
lp->lnd_y); lp->lnd_x, lp->lnd_y);
lp->lnd_own = 0; lp->lnd_own = 0;
lp->lnd_effic = 0; lp->lnd_effic = 0;
lp->lnd_ship = -1; lp->lnd_ship = -1;
@ -97,8 +97,8 @@ shp_prewrite(int n, void *ptr)
for (i = 0; NULL != (pp = getplanep(i)); i++) { for (i = 0; NULL != (pp = getplanep(i)); i++) {
if (pp->pln_own && pp->pln_ship == n) { if (pp->pln_own && pp->pln_ship == n) {
mpr(pp->pln_own, "%s sunk!\n", prplane(pp)); mpr(pp->pln_own, "%s sunk!\n", prplane(pp));
makelost(EF_PLANE, pp->pln_own, pp->pln_uid, pp->pln_x, makelost(EF_PLANE, pp->pln_own, pp->pln_uid,
pp->pln_y); pp->pln_x, pp->pln_y);
pp->pln_own = 0; pp->pln_own = 0;
pp->pln_effic = 0; pp->pln_effic = 0;
pp->pln_ship = -1; pp->pln_ship = -1;

View file

@ -404,8 +404,8 @@ sect_has_dock(struct sctstr *sect)
} }
static int static int
shp_count(struct emp_qelem *list, int wantflags, int nowantflags, int x, shp_count(struct emp_qelem *list, int wantflags, int nowantflags,
int y) int x, int y)
{ {
struct emp_qelem *qp; struct emp_qelem *qp;
struct emp_qelem *next; struct emp_qelem *next;
@ -686,8 +686,8 @@ shp_fort_interdiction(struct emp_qelem *list, coord newx, coord newy,
continue; continue;
shell = fsect.sct_item[I_SHELL]; shell = fsect.sct_item[I_SHELL];
if (shell < 1) if (shell < 1)
shell += supply_commod(fsect.sct_own, shell += supply_commod(fsect.sct_own, fsect.sct_x, fsect.sct_y,
fsect.sct_x, fsect.sct_y, I_SHELL, 1); I_SHELL, 1);
if (shell < 1) if (shell < 1)
continue; continue;
shell--; shell--;

View file

@ -90,7 +90,8 @@ resupply_commod(struct lndstr *lp, i_type type)
/* Ok, do we now have enough? */ /* Ok, do we now have enough? */
amt = get_minimum(lp, type) - lp->lnd_item[type]; amt = get_minimum(lp, type) - lp->lnd_item[type];
if (amt > 0) { if (amt > 0) {
lp->lnd_item[type] += supply_commod(lp->lnd_own, lp->lnd_x, lp->lnd_y, lp->lnd_item[type] += supply_commod(lp->lnd_own,
lp->lnd_x, lp->lnd_y,
type, amt); type, amt);
amt = get_minimum(lp, type) - lp->lnd_item[type]; amt = get_minimum(lp, type) - lp->lnd_item[type];
} }
@ -550,8 +551,8 @@ use_supply(struct lndstr *lp)
if (shells < shells_needed) { if (shells < shells_needed) {
lp->lnd_item[I_SHELL] = 0; lp->lnd_item[I_SHELL] = 0;
putland(lp->lnd_uid, lp); putland(lp->lnd_uid, lp);
shells += supply_commod(lp->lnd_own, lp->lnd_x, lp->lnd_y, I_SHELL, shells += supply_commod(lp->lnd_own, lp->lnd_x, lp->lnd_y,
(shells_needed - shells)); I_SHELL, shells_needed - shells);
lp->lnd_item[I_SHELL] = shells; lp->lnd_item[I_SHELL] = shells;
} }
@ -566,8 +567,8 @@ use_supply(struct lndstr *lp)
if (food < food_needed) { if (food < food_needed) {
lp->lnd_item[I_FOOD] = 0; lp->lnd_item[I_FOOD] = 0;
putland(lp->lnd_uid, lp); putland(lp->lnd_uid, lp);
food += supply_commod(lp->lnd_own, lp->lnd_x, lp->lnd_y, I_FOOD, food += supply_commod(lp->lnd_own, lp->lnd_x, lp->lnd_y,
(food_needed - food)); I_FOOD, food_needed - food);
lp->lnd_item[I_FOOD] = food; lp->lnd_item[I_FOOD] = food;
} }
@ -588,9 +589,8 @@ use_supply(struct lndstr *lp)
if (petrol < petrol_needed) { if (petrol < petrol_needed) {
lp->lnd_item[I_PETROL] = 0; lp->lnd_item[I_PETROL] = 0;
putland(lp->lnd_uid, lp); putland(lp->lnd_uid, lp);
petrol += supply_commod(lp->lnd_own, petrol += supply_commod(lp->lnd_own, lp->lnd_x, lp->lnd_y,
lp->lnd_x, lp->lnd_y, I_PETROL, petrol_needed - petrol);
I_PETROL, (petrol_needed - petrol));
lp->lnd_item[I_PETROL] = petrol; lp->lnd_item[I_PETROL] = petrol;
} }

View file

@ -250,8 +250,8 @@ takeover_ship(struct shpstr *sp, natid newown, int hostile)
pp->pln_mission = 0; pp->pln_mission = 0;
makelost(EF_PLANE, pp->pln_own, pp->pln_uid, pp->pln_x, pp->pln_y); makelost(EF_PLANE, pp->pln_own, pp->pln_uid, pp->pln_x, pp->pln_y);
pp->pln_own = newown; pp->pln_own = newown;
makenotlost(EF_PLANE, pp->pln_own, pp->pln_uid, pp->pln_x, makenotlost(EF_PLANE, pp->pln_own, pp->pln_uid,
pp->pln_y); pp->pln_x, pp->pln_y);
putplane(pp->pln_uid, pp); putplane(pp->pln_uid, pp);
} }
/* Take over land units */ /* Take over land units */
@ -287,11 +287,11 @@ takeover_land(struct lndstr *landp, natid newown, int hostile)
if (opt_MARKET) if (opt_MARKET)
trdswitchown(EF_LAND, landp, newown); trdswitchown(EF_LAND, landp, newown);
landp->lnd_mission = 0; landp->lnd_mission = 0;
makelost(EF_LAND, landp->lnd_own, landp->lnd_uid, landp->lnd_x, makelost(EF_LAND, landp->lnd_own, landp->lnd_uid,
landp->lnd_y); landp->lnd_x, landp->lnd_y);
landp->lnd_own = newown; landp->lnd_own = newown;
makenotlost(EF_LAND, landp->lnd_own, landp->lnd_uid, landp->lnd_x, makenotlost(EF_LAND, landp->lnd_own, landp->lnd_uid,
landp->lnd_y); landp->lnd_x, landp->lnd_y);
pp = &p; pp = &p;
lp = &llp; lp = &llp;
/* Take over planes */ /* Take over planes */
@ -313,8 +313,8 @@ takeover_land(struct lndstr *landp, natid newown, int hostile)
pp->pln_mission = 0; pp->pln_mission = 0;
makelost(EF_PLANE, pp->pln_own, pp->pln_uid, pp->pln_x, pp->pln_y); makelost(EF_PLANE, pp->pln_own, pp->pln_uid, pp->pln_x, pp->pln_y);
pp->pln_own = newown; pp->pln_own = newown;
makenotlost(EF_PLANE, pp->pln_own, pp->pln_uid, pp->pln_x, makenotlost(EF_PLANE, pp->pln_own, pp->pln_uid,
pp->pln_y); pp->pln_x, pp->pln_y);
putplane(pp->pln_uid, pp); putplane(pp->pln_uid, pp);
} }
/* Take over land units */ /* Take over land units */

View file

@ -192,8 +192,9 @@ assemble_dist_paths(struct distinfo *distptrs)
/* now, get the dist sector */ /* now, get the dist sector */
dist = getsectp(sp->sct_dist_x, sp->sct_dist_y); dist = getsectp(sp->sct_dist_x, sp->sct_dist_y);
if (dist == NULL) { if (dist == NULL) {
logerror("Bad dist sect %d,%d for %d,%d !\n", sp->sct_dist_x, logerror("Bad dist sect %d,%d for %d,%d !\n",
sp->sct_dist_y, sp->sct_x, sp->sct_y); sp->sct_dist_x, sp->sct_dist_y,
sp->sct_x, sp->sct_y);
continue; continue;
} }
/* Now, get the best distribution path over roads */ /* Now, get the best distribution path over roads */

View file

@ -102,9 +102,9 @@ do_feed(struct sctstr *sp, struct natstr *np, short *vec,
needed = ldround((double)(1 + etu * people * eatrate), 1); needed = ldround((double)(1 + etu * people * eatrate), 1);
/* Now, find some food */ /* Now, find some food */
vec[I_FOOD] = supply_commod(sp->sct_own, sp->sct_x, vec[I_FOOD] = supply_commod(sp->sct_own,
sp->sct_y, I_FOOD, needed); sp->sct_x, sp->sct_y,
I_FOOD, needed);
} }
} }
starved = feed_people(vec, etu, &needed); starved = feed_people(vec, etu, &needed);

View file

@ -129,8 +129,8 @@ upd_land(struct lndstr *lp, int etus,
if (np->nat_priorities[PRI_LBUILD] == 0 || np->nat_money < 0) if (np->nat_priorities[PRI_LBUILD] == 0 || np->nat_money < 0)
return; return;
if (lp->lnd_effic < LAND_MINEFF || !landrepair(lp, np, bp, etus)) { if (lp->lnd_effic < LAND_MINEFF || !landrepair(lp, np, bp, etus)) {
makelost(EF_LAND, lp->lnd_own, lp->lnd_uid, lp->lnd_x, makelost(EF_LAND, lp->lnd_own, lp->lnd_uid,
lp->lnd_y); lp->lnd_x, lp->lnd_y);
lp->lnd_own = 0; lp->lnd_own = 0;
return; return;
} }
@ -147,8 +147,8 @@ upd_land(struct lndstr *lp, int etus,
if ((eff = lp->lnd_effic - etus / 5) < LAND_MINEFF) { if ((eff = lp->lnd_effic - etus / 5) < LAND_MINEFF) {
wu(0, lp->lnd_own, wu(0, lp->lnd_own,
"%s lost to lack of maintenance\n", prland(lp)); "%s lost to lack of maintenance\n", prland(lp));
makelost(EF_LAND, lp->lnd_own, lp->lnd_uid, lp->lnd_x, makelost(EF_LAND, lp->lnd_own, lp->lnd_uid,
lp->lnd_y); lp->lnd_x, lp->lnd_y);
lp->lnd_own = 0; lp->lnd_own = 0;
return; return;
} }

View file

@ -328,8 +328,8 @@ do_mob_ship(struct shpstr *sp, int etus)
if ((d - (int)d) > 0.0) if ((d - (int)d) > 0.0)
d++; d++;
need = (int)d; need = (int)d;
newfuel = supply_commod(sp->shp_own, sp->shp_x, newfuel = supply_commod(sp->shp_own, sp->shp_x, sp->shp_y,
sp->shp_y, I_PETROL, need); I_PETROL, need);
sp->shp_fuel += newfuel * 5; sp->shp_fuel += newfuel * 5;
} }
@ -347,8 +347,8 @@ do_mob_ship(struct shpstr *sp, int etus)
if ((d - (int)d) > 0.0) if ((d - (int)d) > 0.0)
d++; d++;
need = (int)d; need = (int)d;
newfuel = supply_commod(sp->shp_own, sp->shp_x, newfuel = supply_commod(sp->shp_own, sp->shp_x, sp->shp_y,
sp->shp_y, I_OIL, need); I_OIL, need);
sp->shp_fuel += newfuel * 50; sp->shp_fuel += newfuel * 50;
} }
@ -444,8 +444,8 @@ do_mob_land(struct lndstr *lp, int etus)
if ((d - (int)d) > 0.0) if ((d - (int)d) > 0.0)
d++; d++;
need = (int)d; need = (int)d;
newfuel = supply_commod(lp->lnd_own, lp->lnd_x, newfuel = supply_commod(lp->lnd_own, lp->lnd_x, lp->lnd_y,
lp->lnd_y, I_PETROL, need); I_PETROL, need);
lp->lnd_fuel += newfuel * 5; lp->lnd_fuel += newfuel * 5;
} }
@ -461,8 +461,8 @@ do_mob_land(struct lndstr *lp, int etus)
if ((d - (int)d) > 0.0) if ((d - (int)d) > 0.0)
d++; d++;
need = (int)d; need = (int)d;
newfuel = supply_commod(lp->lnd_own, lp->lnd_x, newfuel = supply_commod(lp->lnd_own, lp->lnd_x, lp->lnd_y,
lp->lnd_y, I_OIL, need); I_OIL, need);
lp->lnd_fuel += newfuel * 50; lp->lnd_fuel += newfuel * 50;
} }

View file

@ -219,8 +219,8 @@ auto_fuel_ship(struct shpstr *sp)
d++; d++;
need = (int)d; need = (int)d;
newfuel = supply_commod(sp->shp_own, sp->shp_x, newfuel = supply_commod(sp->shp_own, sp->shp_x, sp->shp_y,
sp->shp_y, I_PETROL, need); I_PETROL, need);
add_fuel += newfuel * 5; add_fuel += newfuel * 5;
if (add_fuel > maxfuel) if (add_fuel > maxfuel)
add_fuel = maxfuel; add_fuel = maxfuel;
@ -238,8 +238,8 @@ auto_fuel_ship(struct shpstr *sp)
d++; d++;
need = (int)d; need = (int)d;
newfuel = supply_commod(sp->shp_own, sp->shp_x, newfuel = supply_commod(sp->shp_own, sp->shp_x, sp->shp_y,
sp->shp_y, I_OIL, need); I_OIL, need);
add_fuel = newfuel * 50; add_fuel = newfuel * 50;
if (add_fuel > maxfuel) if (add_fuel > maxfuel)
add_fuel = maxfuel; add_fuel = maxfuel;

View file

@ -113,8 +113,8 @@ prod_plane(int etus, int natnum, int *bp, int buildem)
/* nplane is unsigned... */ /* nplane is unsigned... */
if (shp->shp_nplane > 0) if (shp->shp_nplane > 0)
shp->shp_nplane--; shp->shp_nplane--;
makelost(EF_PLANE, pp->pln_own, pp->pln_uid, pp->pln_x, makelost(EF_PLANE, pp->pln_own, pp->pln_uid,
pp->pln_y); pp->pln_x, pp->pln_y);
pp->pln_own = 0; pp->pln_own = 0;
continue; continue;
} }
@ -135,8 +135,8 @@ prod_plane(int etus, int natnum, int *bp, int buildem)
if ((eff = pp->pln_effic - etus / 5) < PLANE_MINEFF) { if ((eff = pp->pln_effic - etus / 5) < PLANE_MINEFF) {
wu(0, pp->pln_own, wu(0, pp->pln_own,
"%s lost to lack of maintenance\n", prplane(pp)); "%s lost to lack of maintenance\n", prplane(pp));
makelost(EF_PLANE, pp->pln_own, pp->pln_uid, pp->pln_x, makelost(EF_PLANE, pp->pln_own, pp->pln_uid,
pp->pln_y); pp->pln_x, pp->pln_y);
pp->pln_own = 0; pp->pln_own = 0;
continue; continue;
} }

View file

@ -132,8 +132,8 @@ upd_ship(struct shpstr *sp, int etus,
if (np->nat_priorities[PRI_SBUILD] == 0 || np->nat_money < 0) if (np->nat_priorities[PRI_SBUILD] == 0 || np->nat_money < 0)
return; return;
if (sp->shp_effic < SHIP_MINEFF || !shiprepair(sp, np, bp, etus)) { if (sp->shp_effic < SHIP_MINEFF || !shiprepair(sp, np, bp, etus)) {
makelost(EF_SHIP, sp->shp_own, sp->shp_uid, sp->shp_x, makelost(EF_SHIP, sp->shp_own, sp->shp_uid,
sp->shp_y); sp->shp_x, sp->shp_y);
sp->shp_own = 0; sp->shp_own = 0;
return; return;
} }
@ -147,8 +147,8 @@ upd_ship(struct shpstr *sp, int etus,
if ((eff = sp->shp_effic - etus / 5) < SHIP_MINEFF) { if ((eff = sp->shp_effic - etus / 5) < SHIP_MINEFF) {
wu(0, sp->shp_own, wu(0, sp->shp_own,
"%s lost to lack of maintenance\n", prship(sp)); "%s lost to lack of maintenance\n", prship(sp));
makelost(EF_SHIP, sp->shp_own, sp->shp_uid, sp->shp_x, makelost(EF_SHIP, sp->shp_own, sp->shp_uid,
sp->shp_y); sp->shp_x, sp->shp_y);
sp->shp_own = 0; sp->shp_own = 0;
return; return;
} }