*/
/* What are we boarding? */
-
- if (!(p = getstarg(player->argp[1], "Victim ship #? ", buf)) ||
- (def->shp_uid = atoi(p)) < 0)
+ p = getstarg(player->argp[1], "Victim ship #? ", buf);
+ if (!p || (def->shp_uid = atoi(p)) < 0)
return RET_SYN;
/*
sprintf(prompt, "%s %s %s threshold or direction or 'query'? ",
xyas(nstr.x, nstr.y, player->cnum),
dchr[sect.sct_type].d_name, ich->i_name);
- if (!(p = getstarg(player->argp[3], prompt, buf)) || !*p)
+ p = getstarg(player->argp[3], prompt, buf);
+ if (!p || !*p)
return RET_SYN;
if (*p != 'q') {
if (((*p >= '0') && (*p <= '9')) || *p == '+') {
return RET_SYN;
if (!snxtsct(&nstr, p))
return RET_SYN;
- if ((p = getstarg(player->argp[2], "amount : ", buf)) == 0 || *p == 0)
+ p = getstarg(player->argp[2], "amount : ", buf);
+ if (!p || !*p)
return RET_SYN;
qty = atoi(p);
if (qty < 0)
if (!snxtitem(&ni, EF_PLANE, player->argp[1], NULL))
return RET_SYN;
- if ((p = getstarg(player->argp[2], "Increase by? ", buf)) == 0
- || *p == 0)
+ p = getstarg(player->argp[2], "Increase by? ", buf);
+ if (!p || !*p)
return RET_SYN;
level = atoi(p);
if (level < 0)
sprintf(prompt, "Sector %s has a %s of %d%%. Improve how much? ",
xyas(sect.sct_x, sect.sct_y, player->cnum),
intrchr[type].in_name, value);
- if (!(p = getstarg(player->argp[3], prompt, buf)) || !*p)
+ p = getstarg(player->argp[3], prompt, buf);
+ if (!p || !*p)
continue;
if (!check_sect_ok(§))
continue;
*/
/* What are we boarding? */
-
- if (!(p = getstarg(player->argp[1], "Victim land unit #? ", buf)) ||
- (def->lnd_uid = atoi(p)) < 0)
+ p = getstarg(player->argp[1], "Victim land unit #? ", buf);
+ if (!p || (def->lnd_uid = atoi(p)) < 0)
return RET_SYN;
/*
char *p;
char buf[1024];
- if (!(p = getstarg(player->argp[1],
- "What commodity (or 'plane' or 'land')? ", buf))
- || !*p)
+ p = getstarg(player->argp[1],
+ "What commodity (or 'plane' or 'land')? ", buf);
+ if (!p || !*p)
return RET_SYN;
if (!strncmp(p, "plane", 5))
return RET_SYN;
}
- if (!(p = getstarg(player->argp[2], "Ship(s): ", buf)) || !*p)
+ p = getstarg(player->argp[2], "Ship(s): ", buf);
+ if (!p || !*p)
return RET_SYN;
noisy = isdigit(*p);
char *p;
char buf[1024];
- if (!(p = getstarg(player->argp[1],
- "What commodity (or 'plane' or 'land')? ", buf))
- || !*p)
+ p = getstarg(player->argp[1],
+ "What commodity (or 'plane' or 'land')? ", buf);
+ if (!p || !*p)
return RET_SYN;
if (!strncmp(p, "plane", 5))
type = EF_PLANE;
return RET_SYN;
}
- if (!(p = getstarg(player->argp[2], "Unit(s): ", buf)) || !*p)
+ p = getstarg(player->argp[2], "Unit(s): ", buf);
+ if (!p || !*p)
return RET_SYN;
noisy = isdigit(*p);
(load_unload == UNLOAD) ?
"unload from" : "load onto",
prship(sp), xyas(sp->shp_x, sp->shp_y, player->cnum));
- if (!(p = getstarg(player->argp[3], prompt, buf)) || !*p)
+ p = getstarg(player->argp[3], prompt, buf);
+ if (!p || !*p)
return RET_SYN;
if (!still_ok_ship(sectp, sp))
(load_unload == UNLOAD) ?
"unload from" : "load onto",
prland(lp), xyas(lp->lnd_x, lp->lnd_y, player->cnum));
- if (!(p = getstarg(player->argp[3], prompt, buf)) || !*p)
+ p = getstarg(player->argp[3], prompt, buf);
+ if (!p || !*p)
return RET_SYN;
if (!still_ok_land(sectp, lp))
return RET_FAIL;
}
- if ((p = getstarg(player->argp[4], "operations point? ", buf)) == 0
- || *p == 0)
+ p = getstarg(player->argp[4], "operations point? ", buf);
+ if (!p || !*p)
return RET_SYN;
if (*p != '.') {
char *cp;
char buf[1024];
- if (!(cp = getstarg(player->argp[1], "loan or treaty? ", buf)) || !*cp)
+ cp = getstarg(player->argp[1], "loan or treaty? ", buf);
+ if (!cp || !*cp)
return RET_SYN;
switch (*cp) {
orders = 0;
scuttling = 0;
/* Need location */
- if ((p = getstarg(player->argp[3], "Destination? ", buf)) == 0
- || *p == 0)
+ p = getstarg(player->argp[3], "Destination? ", buf);
+ if (!p || !*p)
return RET_SYN;
if (!sarg_xy(p, &p0x, &p0y))
return RET_SYN;
}
check_market();
check_trade();
- if ((p = getstarg(player->argp[1], "Which lot : ", buf)) == 0
- || *p == 0)
+ p = getstarg(player->argp[1], "Which lot : ", buf);
+ if (!p || !*p)
return RET_SYN;
number_set = atoi(p);
getcomm(number_set, &comm);
pr("Some one already has a bid out on that\n");
return RET_OK;
}
- if ((p = getstarg(player->argp[2], "New (lower) price: ", buf)) == 0
- || *p == 0)
+ p = getstarg(player->argp[2], "New (lower) price: ", buf);
+ if (!p || !*p)
return RET_SYN;
if (!check_comm_ok(&comm))
return RET_FAIL;
if (!player->owner)
continue;
p = &map[ns.dy][ns.dx * 2];
- if ((dir = sect.sct_del[i_del] & 0x7) &&
- nstr_exec(cond, ncond, §))
+ dir = sect.sct_del[i_del] & 0x7;
+ if (dir && nstr_exec(cond, ncond, §))
memcpy(p, routech[dir], 3);
p[1] = dchr[sect.sct_type].d_mnem;
}
return RET_FAIL;
}
number_sub = 0;
- if ((p = getstarg(player->argp[3], "Quantity: ", buf)) == 0 || *p == 0)
+ p = getstarg(player->argp[3], "Quantity: ", buf);
+ if (!p || !*p)
return RET_SYN;
if (!check_sect_ok(§))
return RET_FAIL;
number_set = atoi(p);
- if ((p = getstarg(player->argp[4], "Price per unit: ", buf)) == 0 ||
- *p == 0)
+ p = getstarg(player->argp[4], "Price per unit: ", buf);
+ if (!p || !*p)
return RET_SYN;
if (!check_sect_ok(§))
return RET_FAIL;
if (!snxtsct(&nstr, player->argp[2]))
return RET_SYN;
while (nxtsct(&nstr, §) > 0) {
- if (!(p = getstarg(player->argp[3], "What value : ", buf)) ||
- (*p == '\0'))
+ p = getstarg(player->argp[3], "What value : ", buf);
+ if (!p || !*p)
return RET_SYN;
amt = atoi(p);
if (amt > 100)
if (!snxtsct(&nstr, player->argp[2]))
return RET_SYN;
while (nxtsct(&nstr, §) > 0) {
- if (!(p = getstarg(player->argp[3], "What value : ", buf)) ||
- (*p == '\0'))
+ p = getstarg(player->argp[3], "What value : ", buf);
+ if (!p || !*p)
return RET_SYN;
amt = atoi(p);
if (amt > 100)
if (!snxtsct(&nstr, player->argp[2]))
return RET_SYN;
while (nxtsct(&nstr, §) > 0) {
- if (!(p = getstarg(player->argp[3], "What value : ", buf)) ||
- (*p == '\0'))
+ p = getstarg(player->argp[3], "What value : ", buf);
+ if (!p || !*p)
return RET_SYN;
amt = atoi(p);
if (amt > 100)
if (!snxtsct(&nstr, player->argp[2]))
return RET_SYN;
while (nxtsct(&nstr, §) > 0) {
- if (!(p = getstarg(player->argp[3], "What value : ", buf)) ||
- (*p == '\0'))
+ p = getstarg(player->argp[3], "What value : ", buf);
+ if (!p || !*p)
return RET_SYN;
amt = atoi(p);
if (amt > 100)
if (!snxtsct(&nstr, player->argp[2]))
return RET_SYN;
while (nxtsct(&nstr, §) > 0) {
- if (!(p = getstarg(player->argp[3], "What value : ", buf)) ||
- (*p == '\0'))
+ p = getstarg(player->argp[3], "What value : ", buf);
+ if (!p || !*p)
return RET_SYN;
amt = atoi(p);
if (amt > 100)
if (!snxtsct(&nstr, player->argp[2]))
return RET_SYN;
while (nxtsct(&nstr, §) > 0) {
- if (!(p = getstarg(player->argp[3], "What value : ", buf)) ||
- (*p == '\0'))
+ p = getstarg(player->argp[3], "What value : ", buf);
+ if (!p || !*p)
return RET_SYN;
amt = atoi(p);
current = sect.sct_min;
if (!snxtsct(&nstr, player->argp[2]))
return RET_SYN;
while (nxtsct(&nstr, §) > 0) {
- if (!(p = getstarg(player->argp[3], "What value : ", buf)) ||
- (*p == '\0'))
+ p = getstarg(player->argp[3], "What value : ", buf);
+ if (!p || !*p)
return RET_SYN;
amt = atoi(p);
current = sect.sct_gmin;
if (!snxtsct(&nstr, player->argp[2]))
return RET_SYN;
while (nxtsct(&nstr, §) > 0) {
- if (!(p = getstarg(player->argp[3], "What value : ", buf))
- || (*p == '\0'))
+ p = getstarg(player->argp[3], "What value : ", buf);
+ if (!p || !*p)
return RET_SYN;
amt = atoi(p);
current = sect.sct_oil;
if (!snxtsct(&nstr, player->argp[2]))
return RET_SYN;
while (nxtsct(&nstr, §) > 0) {
- if (!(p = getstarg(player->argp[3], "What value : ", buf))
- || (*p == '\0'))
+ p = getstarg(player->argp[3], "What value : ", buf);
+ if (!p || !*p)
return RET_SYN;
amt = atoi(p);
if ((amt < 0) || (amt > MAXNOC - 1))
if (!snxtsct(&nstr, player->argp[2]))
return RET_SYN;
while (nxtsct(&nstr, §) > 0) {
- if (!(p = getstarg(player->argp[3], "What value : ", buf))
- || (*p == '\0'))
+ p = getstarg(player->argp[3], "What value : ", buf);
+ if (!p || !*p)
return RET_SYN;
amt = atoi(p);
if ((amt < 0) || (amt > MAXNOC - 1))
if (!snxtsct(&nstr, player->argp[2]))
return RET_SYN;
while (nxtsct(&nstr, §) > 0) {
- if (!(p = getstarg(player->argp[3], "What value : ", buf)) ||
- (*p == '\0'))
+ p = getstarg(player->argp[3], "What value : ", buf);
+ if (!p || !*p)
return RET_SYN;
amt = atoi(p);
current = sect.sct_effic;
if (!snxtsct(&nstr, player->argp[2]))
return RET_SYN;
while (nxtsct(&nstr, §) > 0) {
- if (!(p = getstarg(player->argp[3], "What value : ", buf))
- || (*p == '\0'))
+ p = getstarg(player->argp[3], "What value : ", buf);
+ if (!p || !*p)
return RET_SYN;
amt = atoi(p);
current = sect.sct_mines;
if (!snxtsct(&nstr, player->argp[2]))
return RET_SYN;
while (nxtsct(&nstr, §) > 0) {
- if (!(p = getstarg(player->argp[3], "What value : ", buf))
- || (*p == '\0'))
+ p = getstarg(player->argp[3], "What value : ", buf);
+ if (!p || !*p)
return RET_SYN;
amt = atoi(p);
current = sect.sct_mobil;
if (!snxtsct(&nstr, player->argp[2]))
return RET_SYN;
while (nxtsct(&nstr, §) > 0) {
- if (!(p = getstarg(player->argp[3], "What value : ", buf)) ||
- (*p == '\0'))
+ p = getstarg(player->argp[3], "What value : ", buf);
+ if (!p || !*p)
return RET_SYN;
amt = atoi(p);
current = sect.sct_avail;
if (!snxtsct(&nstr, player->argp[2]))
return RET_SYN;
while (nxtsct(&nstr, §) > 0) {
- if (!(p = getstarg(player->argp[3], "What value : ", buf)) ||
- (*p == '\0'))
+ p = getstarg(player->argp[3], "What value : ", buf);
+ if (!p || !*p)
return RET_SYN;
amt = atoi(p);
current = sect.sct_work;
if (!snxtsct(&nstr, player->argp[2]))
return RET_SYN;
while (nxtsct(&nstr, §) > 0) {
- if (!(p = getstarg(player->argp[3], "What value : ", buf)) ||
- (*p == '\0'))
+ p = getstarg(player->argp[3], "What value : ", buf);
+ if (!p || !*p)
return RET_SYN;
amt = atoi(p);
current = sect.sct_fertil;
if (!snxtsct(&nstr, player->argp[2]))
return RET_SYN;
while (nxtsct(&nstr, §) > 0) {
- if (!(p = getstarg(player->argp[3], "What value : ", buf)) ||
- (*p == '\0'))
+ p = getstarg(player->argp[3], "What value : ", buf);
+ if (!p || !*p)
return RET_SYN;
amt = atoi(p);
current = sect.sct_uran;
char buf[1024];
int rlev;
- if (!(p = getstarg(player->argp[1],
- "Show what (bridge, item, land, nuke, plane, sect, ship, tower, updates)? ",
- buf))
- || !*p)
+ p = getstarg(player->argp[1],
+ "Show what (bridge, item, land, nuke, plane, sect, ship, tower, updates)? ",
+ buf);
+ if (!p || !*p)
return RET_SYN;
natp = getnatp(player->cnum);
return RET_SYN;
}
- if (!(p = getstarg(player->argp[2],
- "Build, stats, or capability data (b,s,c)? ", buf))
- || !*p)
+ p = getstarg(player->argp[2],
+ "Build, stats, or capability data (b,s,c)? ", buf);
+ if (!p || !*p)
return RET_SYN;
pr("Printing for tech level '%d'\n", tlev);
if (*p == 'B' || *p == 'b')
char prompt[512];
char buf[1024];
- if (!(p = getstarg(player->argp[1],
- "Tend what commodity (or 'land')? ", buf)) || !*p)
+ p = getstarg(player->argp[1], "Tend what commodity (or 'land')? ",
+ buf);
+ if (!p || !*p)
return RET_SYN;
if (!strncmp(p, "land", 4))
pr("Nothing to buy at the moment...\n");
return RET_OK;
}
- if ((p = getstring("Which lot to buy: ", buf)) == 0 || *p == 0)
+ p = getstring("Which lot to buy: ", buf);
+ if (!p || !*p)
return RET_OK;
if (isdigit(*p) == 0)
return RET_OK;
}
}
- if ((p = getstring("How much do you bid: ", buf)) == 0 || *p == 0)
+ p = getstring("How much do you bid: ", buf);
+ if (!p || !*p)
return RET_OK;
if (!trade_check_ok(&trade, &tg))
return RET_FAIL;
return;
sprintf(prompt, "How many mil to move in from %s (%d max)? ",
xyas(off->x, off->y, player->cnum), mob_support);
- if (!(p = getstring(prompt, buf)) || !*p || (num_mil = atoi(p)) <= 0)
+ p = getstring(prompt, buf);
+ if (!p || !*p || (num_mil = atoi(p)) <= 0)
return;
/* Make sure we don't move in more than we can support mobility-wise */
if (num_mil > mob_support)