char buf[1024];
natp = getnatp(player->cnum);
- if ((p =
- getstarg(player->argp[1],
- "Build (ship, nuke, bridge, plane, land unit, tower)? ",
- buf)) == 0)
+ p = getstarg(player->argp[1],
+ "Build (ship, nuke, bridge, plane, land unit, tower)? ",
+ buf);
+ if (p == 0)
return RET_SYN;
what = *p;
if (is_sector && is_ship) {
int type;
- if ((p =
- getstarg(player->argp[3], "Cede sectors or ships (se, sh)? ",
- buf)) == 0)
+ p = getstarg(player->argp[3], "Cede sectors or ships (se, sh)? ",
+ buf);
+ if (p == 0)
return RET_FAIL;
if (strlen(p) > 4)
p[2] = 0;
char buf[1024];
struct natstr *us;
- if ((p =
- getstarg(player->argp[1], "country name or representative? ",
- buf)) == 0)
+ p = getstarg(player->argp[1], "country name or representative? ", buf);
+ if (p == 0)
return RET_SYN;
us = getnatp(player->cnum);
if (us->nat_stat == STAT_VIS) {
charge = us->nat_money / 10;
}
}
- if ((p =
- getstarg(player->argp[2], "New country name -- ", buf)) == 0)
+ p = getstarg(player->argp[2], "New country name -- ", buf);
+ if (p == 0)
return RET_SYN;
if (!check_nat_name(p))
return RET_FAIL;
case 'p':
case 'r':
pr("(note: these are stored in plain text.)\n");
- if ((p = getstarg(player->argp[2],
- "New representative name -- ", buf)) == 0)
+ p = getstarg(player->argp[2], "New representative name -- ", buf);
+ if (p == 0)
return RET_SYN;
p[sizeof(us->nat_pnam) - 1] = 0;
strcpy(us->nat_pnam, p);
}
pr("You are owed $%.2f on that loan.\n", owed);
- if (!(p = getstarg(player->argp[2],
- "What sector do you wish to confiscate? ", buf)))
+ p = getstarg(player->argp[2],
+ "What sector do you wish to confiscate? ", buf);
+ if (!p)
return RET_SYN;
if (!check_loan_ok(&loan))
return RET_FAIL;
char *p;
char buf[1024];
- if (!(p = getstarg(player->argp[1],
- "alliance, friendly, neutrality, hostility, or war? ",
- buf)))
+ p = getstarg(player->argp[1],
+ "alliance, friendly, neutrality, hostility, or war? ",
+ buf);
+ if (!p)
return RET_SYN;
switch (*p) {
case 'a':
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)))
+ p = getstarg(player->argp[3],
+ "New civilians on active reserve? (y/n) ", buf);
+ if (!p)
return RET_SYN;
if (*p != 'y' && *p != 'n')
return RET_SYN;
char buf[1024];
char ewhat;
- if ((what = getstarg(player->argp[1],
- "Edit What (country, land, ship, plane, nuke, unit)? ",
- buf)) == 0)
+ what = getstarg(player->argp[1],
+ "Edit What (country, land, ship, plane, nuke, unit)? ",
+ buf);
+ if (what == 0)
return RET_SYN;
ewhat = what[0];
switch (ewhat) {
switch (type) {
case EF_PLANE:
- if (0 !=
- (retval =
- load_plane_ship(§, &ship, noisy, load_unload,
- &nships)))
+ retval = load_plane_ship(§, &ship, noisy, load_unload,
+ &nships);
+ if (retval != 0)
return retval;
break;
case EF_LAND:
- if (0 !=
- (retval =
- load_land_ship(§, &ship, noisy, load_unload,
- &nships)))
+ retval = load_land_ship(§, &ship, noisy, load_unload,
+ &nships);
+ if (retval != 0)
return retval;
break;
case EF_SECTOR:
- if (0 !=
- (retval =
- load_comm_ship(§, &ship, ich, load_unload, &nships)))
+ retval = load_comm_ship(§, &ship, ich, load_unload,
+ &nships);
+ if (retval != 0)
return retval;
}
/* load/unload plague */
switch (type) {
case EF_LAND:
- if (0 !=
- (retval =
- load_land_land(§, &land, noisy, load_unload,
- &nunits)))
+ retval = load_land_land(§, &land, noisy, load_unload,
+ &nunits);
+ if (retval != 0)
return retval;
break;
case EF_PLANE:
- if (0 !=
- (retval =
- load_plane_land(§, &land, noisy, load_unload,
- &nunits)))
+ retval = load_plane_land(§, &land, noisy, load_unload,
+ &nunits);
+ if (retval != 0)
return retval;
break;
case EF_SECTOR:
- if (0 !=
- (retval =
- load_comm_land(§, &land, ich, load_unload, &nunits)))
+ retval = load_comm_land(§, &land, ich, load_unload,
+ &nunits);
+ if (retval != 0)
return retval;
}
/* load/unload plague */
while (nxtitem(&tenders, &tender)) {
if (!player->owner)
continue;
- if ((p =
- getstarg(player->argp[3], "Amount to transfer? ", buf)) == 0)
+ if (!(p = getstarg(player->argp[3], "Amount to transfer? ", buf)))
return RET_FAIL;
if (!check_ship_ok(&tender))
return RET_FAIL;
emp_initque(&fired);
emp_initque(&defended);
- if (!(p = getstarg(player->argp[1],
- "Firing from ship(s), sect(s), or land unit(s)? ",
- buf)))
+ p = getstarg(player->argp[1],
+ "Firing from ship(s), sect(s), or land unit(s)? ", buf);
+ if (!p)
return RET_SYN;
type = ef_byname_from(p, ef_with_guns);
if (opt_NO_FORT_FIRE && type == EF_SECTOR) {
struct nstr_item ni;
char buf[1024];
- if ((p =
- getstarg(player->argp[1], "Ship, plane or land unit (p,sh,la)? ",
- buf)) == 0)
+ p = getstarg(player->argp[1], "Ship, plane or land unit (p,sh,la)? ",
+ buf);
+ if (p == 0)
return RET_SYN;
type = ef_byname_from(p, ef_with_missions);
if (type < 0) {
if (!snxtitem(&ni, type, player->argp[2], NULL))
return RET_SYN;
- if ((p =
- getstarg(player->argp[3],
- "Mission (int, sup, osup, dsup, esc, res, air, query, clear)? ",
- buf)) == 0)
+ p = getstarg(player->argp[3],
+ "Mission (int, sup, osup, dsup, esc, res, air, query, clear)? ",
+ buf);
+ if (p == 0)
return RET_SYN;
/*
pr("That's not one of the choices!\n");
return RET_SYN;
}
- if ((p =
- getstarg(player->argp[2],
- "mail, treaties, loans, or announcements? ", buf)) == 0)
+ p = getstarg(player->argp[2],
+ "mail, treaties, loans, or announcements? ", buf);
+ if (p == 0)
return RET_SYN;
switch (*p) {
case 'a':
struct nstr_sect nstr;
char buf[1024];
- if ((what = getstarg(player->argp[1],
- "Set What (iron, gold, oil, uranium, fertility)? ",
- buf)) == 0)
+ what = getstarg(player->argp[1],
+ "Set What (iron, gold, oil, uranium, fertility)? ",
+ buf);
+ if (what == 0)
return RET_SYN;
switch (what[0]) {
case 'i':
char buf[1024];
char char0, char1;
- if ((what = getstarg(player->argp[1],
- "Give What (iron, gold, oil, uranium, fertility, owner, eff., mob., work, avail., oldown, mines)? ",
- buf)) == 0)
+ what = getstarg(player->argp[1],
+ "Give What (iron, gold, oil, uranium, fertility, owner, eff., mob., work, avail., oldown, mines)? ",
+ buf);
+ if (what == 0)
return RET_SYN;
char0 = what[0];
char1 = what[1];
*fortp = *shipp = 0;
*landp = *planep = 0;
- if (!(p = getstarg(player->argp[offset], "Use fort support? ",
- buf)))
+ p = getstarg(player->argp[offset], "Use fort support? ", buf);
+ if (!p)
return RET_SYN;
if ((*p == 'y') || (*p == 'Y'))
*fortp = 1;
- if (!(p = getstarg(player->argp[offset + 1], "Use ship support? ",
- buf)))
+ p = getstarg(player->argp[offset + 1], "Use ship support? ", buf);
+ if (!p)
return RET_SYN;
if ((*p == 'y') || (*p == 'Y'))
*shipp = 1;
- if (!(p = getstarg(player->argp[offset + 2], "Use land support? ",
- buf)))
+ p = getstarg(player->argp[offset + 2], "Use land support? ", buf);
+ if (!p)
return RET_SYN;
if ((*p == 'y') || (*p == 'Y'))
*landp = 1;
- if (!(p = getstarg(player->argp[offset + 3], "Use plane support? ",
- buf)))
+ p = getstarg(player->argp[offset + 3], "Use plane support? ", buf);
+ if (!p)
return RET_SYN;
if ((*p == 'y') || (*p == 'Y'))