/* And set some stuff */
from->x = adp->from.x;
/* Here we malloc a whole bunch of tolist pointers. */
- from->tolist = (struct as_topath **)calloc(1,
- sizeof(struct as_topath
- *) * WORLD_Y);
+ from->tolist = calloc(1, sizeof(struct as_topath *) * WORLD_Y);
/* Now, add from to the global list */
from->next = fromhead[adp->from.y];
fromhead[adp->from.y] = from;
wantflags = 0;
if (!snxtitem(&ni_bomb, EF_PLANE, player->argp[1]))
return RET_SYN;
- if (!snxtitem
- (&ni_esc, EF_PLANE, getstarg(player->argp[2], "escort(s)? ", buf)))
+ if (!snxtitem(&ni_esc, EF_PLANE,
+ getstarg(player->argp[2], "escort(s)? ", buf)))
pr("No escorts...\n");
if ((p =
getstarg(player->argp[3], "pinpoint, or strategic? ", buf)) == 0)
nunits = unitsatxy(target->sct_x, target->sct_y, 0, 0);
getvec(VT_ITEM, vec, (s_char *)target, EF_SECTOR);
retry:
- p = getstring
- ("Bomb what? (ship, plane, land unit, efficiency, commodities) ",
- buf);
+ p = getstring("Bomb what? (ship, plane, land unit, efficiency, commodities) ",
+ buf);
if (p == 0 || *p == 0) {
if (player->aborted)
return;
sprintf(msg, "Flak! Firing %d guns from ship %s\n",
flak, prship(&ship));
PR(ship.shp_own, msg);
- if (pinflak_planedamage
- (&plp->plane, plp->pcp, ship.shp_own, flak))
+ if (pinflak_planedamage(&plp->plane, plp->pcp, ship.shp_own, flak))
continue;
}
"Flak! Firing flak guns from unit %s (aa rating %d)\n",
prland(&land), land.lnd_aaf);
PR(land.lnd_own, msg);
- if (pinflak_planedamage
- (&plp->plane, plp->pcp, land.lnd_own, flak))
+ if (pinflak_planedamage(&plp->plane, plp->pcp, land.lnd_own, flak))
continue;
}
owed *= loan.l_amtdue;
/* End overflow fix */
pr("You are owed $%.2f on that loan.\n", owed);
- if (!
- (p =
- getstarg(player->argp[2],
- "What sector do you wish to confiscate? ", buf)))
+ if (!(p = getstarg(player->argp[2],
+ "What sector do you wish to confiscate? ", buf)))
return RET_SYN;
if (!check_loan_ok(&loan))
return RET_FAIL;
s_char *p;
s_char buf[1024];
- if (!
- (p =
- getstarg(player->argp[1],
- "alliance, friendly, neutrality, hostility, or war? ",
- buf)))
+ if (!(p = getstarg(player->argp[1],
+ "alliance, friendly, neutrality, hostility, or war? ",
+ buf)))
return RET_SYN;
switch (*p) {
case 'a':
while (nxtsct(&nstr, §) > 0) {
if (!player->owner)
continue;
-
+
del = getvar(i_del, (s_char *)§, EF_SECTOR);
thresh = del & ~0x7;
dir = del & 0x7;
if (dir < 0)
return RET_SYN;
}
-
+
if (!check_sect_ok(§))
continue;
cash = natp->nat_money;
if (!snxtsct(&nstr, player->argp[1]))
return RET_SYN;
- if ((p =
- getstarg(player->argp[2], "Number to de-mobilize : ", buf)) == 0)
+ if (!(p = getstarg(player->argp[2], "Number to de-mobilize : ", buf)))
return RET_SYN;
number = atoi(p);
- if (!
- (p =
- getstarg(player->argp[3],
- "New civilians on active reserve? (y/n) ", buf)))
+ if (!(p = getstarg(player->argp[3],
+ "New civilians on active reserve? (y/n) ", buf)))
return RET_SYN;
if (*p != 'y' && *p != 'n')
return RET_SYN;
wantflags = 0;
if (!snxtitem(&ni_bomb, EF_PLANE, player->argp[1]))
return RET_SYN;
- if (!snxtitem
- (&ni_esc, EF_PLANE, getstarg(player->argp[2], "escort(s)? ", buf)))
+ if (!snxtitem(&ni_esc, EF_PLANE,
+ getstarg(player->argp[2], "escort(s)? ", buf)))
pr("No escorts...\n");
if ((p = getstarg(player->argp[3], "assembly point? ", buf)) == 0
|| *p == 0)
wantflags = 0;
if (!snxtitem(&ni_bomb, EF_PLANE, player->argp[1]))
return RET_SYN;
- if (!snxtitem
- (&ni_esc, EF_PLANE, getstarg(player->argp[2], "escort(s)? ", buf)))
+ if (!snxtitem(&ni_esc, EF_PLANE,
+ getstarg(player->argp[2], "escort(s)? ", buf)))
pr("No escorts...\n");
if ((p = getstarg(player->argp[3], "assembly point? ", buf)) == 0
|| *p == 0)
if (!player->argp[4])
pr("%s is not in a supplied, efficient harbor\n",
prship(&item.ship));
- if (!snxtitem
- (&tender, EF_SHIP,
- getstarg(player->argp[4], "Oiler? ", buf)))
+ if (!snxtitem (&tender, EF_SHIP,
+ getstarg(player->argp[4], "Oiler? ", buf)))
continue;
if (!check_ship_ok(&item.ship))
pr("No satellites there!\n");
return -1;
}
- if (msl_hit
- (pp, plane.pln_def, EF_PLANE, N_SAT_KILL, N_SAT_KILL,
- prplane(&plane), sx, sy, plane.pln_own)) {
+ if (msl_hit(pp, plane.pln_def, EF_PLANE, N_SAT_KILL, N_SAT_KILL,
+ prplane(&plane), sx, sy, plane.pln_own)) {
dam = pln_damage(pp, sx, sy, 'p', &nukedam, 1);
oldown = plane.pln_own;
planedamage(&plane, dam);
}
sprintf(prompt, "Plane(s) to %s %s? ",
load_unload == LOAD ? "load onto" : "unload from", prship(sp));
- if (!snxtitem
- (&ni, EF_PLANE, p = getstarg(player->argp[3], prompt, buf)))
+ if (!snxtitem(&ni, EF_PLANE,
+ p = getstarg(player->argp[3], prompt, buf)))
return RET_SYN;
if (!still_ok_ship(sectp, sp))
}
sprintf(prompt, "Land unit(s) to %s %s? ",
load_unload == LOAD ? "load onto" : "unload from", prship(sp));
- if (!snxtitem
- (&ni, EF_LAND, p = getstarg(player->argp[3], prompt, buf)))
+ if (!snxtitem(&ni, EF_LAND,
+ p = getstarg(player->argp[3], prompt, buf)))
return RET_SYN;
if (!still_ok_ship(sectp, sp))
}
sprintf(prompt, "Plane(s) to %s %s? ",
load_unload == LOAD ? "load onto" : "unload from", prland(lp));
- if (!snxtitem
- (&ni, EF_PLANE, p = getstarg(player->argp[3], prompt, buf)))
+ if (!snxtitem(&ni, EF_PLANE,
+ p = getstarg(player->argp[3], prompt, buf)))
return RET_SYN;
if (!still_ok_land(sectp, lp))
}
sprintf(prompt, "Land unit(s) to %s %s? ",
load_unload == LOAD ? "load onto" : "unload from", prland(lp));
- if (!snxtitem
- (&ni, EF_LAND, p = getstarg(player->argp[3], prompt, buf)))
+ if (!snxtitem(&ni, EF_LAND,
+ p = getstarg(player->argp[3], prompt, buf)))
return RET_SYN;
if (!still_ok_land(sectp, lp))
if (!(ip = whatitem(player->argp[1], "Transfer what commodity? ")))
return RET_SYN;
- if (!snxtitem
- (&tenders, EF_SHIP, getstarg(player->argp[2], "Tender(s)? ", buf)))
+ if (!snxtitem(&tenders, EF_SHIP,
+ getstarg(player->argp[2], "Tender(s)? ", buf)))
return RET_SYN;
while (nxtitem(&tenders, (s_char *)&tender)) {
if (!player->owner)
range = mapdist(ship.shp_x, ship.shp_y, ax, ay);
if (range > erange)
continue;
- if (!line_of_sight
- ((s_char **)0, ship.shp_x, ship.shp_y, ax, ay))
+ if (!line_of_sight((s_char **)0, ship.shp_x, ship.shp_y, ax, ay))
continue;
(*nfiring)++;
loyalcivs = 0;
/* If they have a military unit there, they still own it */
- if (sp->sct_own != 0 && ((loyalcivs == 0) && (mil == 0) &&
- (has_units
- (sp->sct_x, sp->sct_y, sp->sct_own,
- lp) == 0)))
+ if (sp->sct_own != 0
+ && ((loyalcivs == 0) && (mil == 0)
+ && (has_units(sp->sct_x, sp->sct_y, sp->sct_own, lp) == 0)))
return 1;
return 0;
wantflags = P_P;
if (!snxtitem(&ni_bomb, EF_PLANE, player->argp[1]))
return RET_SYN;
- if (!snxtitem
- (&ni_esc, EF_PLANE, getstarg(player->argp[2], "escort(s)? ", buf)))
+ if (!snxtitem(&ni_esc, EF_PLANE,
+ getstarg(player->argp[2], "escort(s)? ", buf)))
pr("No escorts...\n");
if ((p = getstarg(player->argp[3], "assembly point? ", buf)) == 0
|| *p == 0)
}
pr("Realms for %s (#%d)\n",cname(nat),nat);
natp = getnatp(nat);
- abs.width = 0;
+ abs.width = 0;
abs.height = 0;
while (curr <= lastr) {
b = &natp->nat_b[curr];
wantflags = 0;
if (!snxtitem(&ni_bomb, EF_PLANE, player->argp[1]))
return RET_SYN;
- if (!snxtitem
- (&ni_esc, EF_PLANE, getstarg(player->argp[2], "escort(s)? ", buf)))
+ if (!snxtitem(&ni_esc, EF_PLANE,
+ getstarg(player->argp[2], "escort(s)? ", buf)))
pr("No escorts...\n");
if ((p = getstarg(player->argp[3], "assembly point? ", buf)) == 0
|| *p == 0)
if (tolerance > 2 * ours)
tolerance = (int)(2 * ours);
if (check(buf, theirs, 2 * ours, -1.0, shift, what, tolerance)) ;
- else if (check
- (buf, theirs, 1.5 * ours, 2.0 * ours, shift, what,
+ else if (check(buf, theirs, 1.5 * ours, 2.0 * ours, shift, what,
+ tolerance)) ;
+ else if (check(buf, theirs, 1.2 * ours, 1.5 * ours, shift, what,
tolerance)) ;
- else if (check
- (buf, theirs, 1.2 * ours, 1.5 * ours, shift, what,
- tolerance)) ;
- else if (check
- (buf, theirs, 1.1 * ours, 1.2 * ours, shift, what,
- tolerance)) ;
- else if (check
- (buf, theirs, ours / 1.1, 1.1 * ours, shift, what,
- tolerance)) ;
- else if (check
- (buf, theirs, ours / 1.2, ours / 1.1, shift, what,
- tolerance)) ;
- else if (check
- (buf, theirs, ours / 1.5, ours / 1.2, shift, what,
- tolerance)) ;
- else if (check
- (buf, theirs, ours / 2.0, ours / 1.5, shift, what,
- tolerance)) ;
- else if (check
- (buf, theirs, -1.0, ours / 2.0, shift, what, tolerance)) ;
+ else if (check(buf, theirs, 1.1 * ours, 1.2 * ours, shift, what,
+ tolerance)) ;
+ else if (check(buf, theirs, ours / 1.1, 1.1 * ours, shift, what,
+ tolerance)) ;
+ else if (check(buf, theirs, ours / 1.2, ours / 1.1, shift, what,
+ tolerance)) ;
+ else if (check(buf, theirs, ours / 1.5, ours / 1.2, shift, what,
+ tolerance)) ;
+ else if (check(buf, theirs, ours / 2.0, ours / 1.5, shift, what,
+ tolerance)) ;
+ else if (check(buf, theirs, -1.0, ours / 2.0, shift, what,
+ tolerance)) ;
else
sprintf(buf, " n/a");
} else
!getsect(sectb.sct_x, sectb.sct_y, §b))
return RET_SYN;
print_res(§b);
- if (!confirm
- ("Are you sure these are the two sectors you wish to swap? "))
+ if (!confirm ("Are you sure these are the two sectors you wish to swap? "))
return RET_FAIL;
/* save x and y from secta */
x = secta.sct_x;
return RET_SYN;
}
- if (!snxtitem
- (&tenders, EF_SHIP, getstarg(player->argp[2], "Tender(s)? ", buf)))
+ if (!snxtitem(&tenders, EF_SHIP,
+ getstarg(player->argp[2], "Tender(s)? ", buf)))
return RET_SYN;
while (nxtitem(&tenders, (s_char *)&tender)) {
continue;
}
if (tg.gen.trg_own != trade.trd_owner) {
- logerror
- ("SOmething weird, tg.gen.trg_own != trade.trd_owner!\n");
+ logerror("Something weird, tg.gen.trg_own != trade.trd_owner!\n");
trade.trd_unitid = -1;
puttrade(n, &trade);
continue;
tx = XNORM(tx);
ty = YNORM(ty);
if (mapindex[tx][ty] == 0xFFFF) {
- if (owned_and_navigable
- (bigmap, tx, ty, terrain, own)
+ if (owned_and_navigable(bigmap, tx, ty,
+ terrain, own)
|| (tx == ex && ty == ey && !restr2)) {
mapindex[tx][ty] =
((i + 1) << 13) + routelen;
}
if (id >= ep->fids) {
if (ep->flags & EFF_MEM) {
- logerror
- ("file %s went beyond %d items; won't be able toread item w/o restart",
- ep->name, ep->fids);
+ logerror("file %s went beyond %d items; won't be able toread item w/o restart",
+ ep->name, ep->fids);
} else {
/* write expanded file; ep->fids = last id + 1 */
ep->fids = id + 1;
if (pri < 1)
pri = 1;
/* *LwpContextPtr = 0; */
- if (!
- (LwpCurrent = (struct lwpProc *)calloc(1, sizeof(struct lwpProc))))
+ if (!(LwpCurrent = calloc(1, sizeof(struct lwpProc))))
return (0);
if (!(stack = (int *)malloc(64)))
return (0);
exit(1);
}
#else
- logerror
- ("Alpha/Linux? You don't support SO_REUSEADDR yet, do you?\n");
+ logerror("Alpha/Linux? You don't support SO_REUSEADDR yet, do you?\n");
#endif
if (bind(s, (struct sockaddr *)&sin, sizeof(sin)) < 0) {
logerror("inet socket bind");
&& (sect.sct_oldown != player->cnum)
&& (issneak != SITZKRIEG) && (issneak != MOBILIZATION)) {
pr("You're not at war with them!\n");
- if (!confirm
- ("Do you really want to sneak attack (it will cost you $5000) [yn]? "))
- {
+ if (!confirm("Do you really want to sneak attack (it will cost you $5000) [yn]? ")) {
pr("Sneak attack cancelled!\n");
return abort_attack();
}
*fortp = *shipp = 0;
*landp = *planep = 0;
- if (!
- (p =
- getstarg(player->argp[offset], "Use fort support? ", buf)))
+ if (!(p = getstarg(player->argp[offset], "Use fort support? ",
+ buf)))
return RET_SYN;
if ((*p == 'y') || (*p == 'Y'))
*fortp = 1;
- if (!
- (p =
- getstarg(player->argp[offset + 1], "Use ship support? ",
- buf)))
+ if (!(p = getstarg(player->argp[offset + 1], "Use ship support? ",
+ buf)))
return RET_SYN;
if ((*p == 'y') || (*p == 'Y'))
*shipp = 1;
- if (!
- (p =
- getstarg(player->argp[offset + 2], "Use land support? ",
- buf)))
+ if (!(p = getstarg(player->argp[offset + 2], "Use land support? ",
+ buf)))
return RET_SYN;
if ((*p == 'y') || (*p == 'Y'))
*landp = 1;
- if (!
- (p =
- getstarg(player->argp[offset + 3], "Use plane support? ",
- buf)))
+ if (!p = getstarg(player->argp[offset + 3], "Use plane support? ",
+ buf)))
return RET_SYN;
if ((*p == 'y') || (*p == 'Y'))
continue;
getsect(def->x, def->y, &dsect);
- if (!
- (p =
- (s_char *)BestLandPath(buf, §, &dsect, &move_cost,
- MOB_ROAD)))
+ if (!(p = BestLandPath(buf, §, &dsect, &move_cost, MOB_ROAD)))
continue;
mobcost = land.lnd_effic * 0.01 * lchr[(int)land.lnd_type].l_spd;
if (!(p = getstarg(0, "Carrier #? ", buf)) || !*p)
break;
n = atoi(p);
- if (n < 0 || !getship(n, &ship) || (!player->owner &&
- (getrel
- (getnatp(ship.shp_own),
- player->cnum) !=
- ALLIED))) {
+ if (n < 0 || !getship(n, &ship)
+ || (!player->owner
+ && (getrel(getnatp(ship.shp_own), player->cnum)
+ != ALLIED))) {
pr("Not yours\n");
continue;
}
shutdown_pending);
} else if (shutdown_pending <= 60
&& shutdown_pending % 10 == 0) {
- pr_wall
- ("%sThe server will be shutting down in %d minutes!\n",
- header, shutdown_pending);
+ pr_wall("%sThe server will be shutting down in %d minutes!\n",
+ header, shutdown_pending);
} else if (shutdown_pending % 60 == 0) {
- pr_wall
- ("%sThe server will be shutting down %d hours from now.\n",
- header, (int)(shutdown_pending / 60));
+ pr_wall("%sThe server will be shutting down %d hours from now.\n",
+ header, (int)(shutdown_pending / 60));
}
}
empth_sleep(now + 60);
int big;
if (argc > 1 && argc != 6) {
- printf
- ("usage: %s sectrange mincontdist chunksize numchunks numisle\n",
- *argv);
+ printf("usage: %s sectrange mincontdist chunksize numchunks numisle\n",
+ *argv);
return -1;
}
if (argc == 6) {