int n;
struct emp_qelem *qp;
int shipno;
- int ignore;
struct shpstr ship;
int nships = 0;
struct shiplist *head = NULL;
int gun;
int shell;
- for (qp = list->q_forw; qp != list && !player->aborted;
- qp = qp->q_forw) {
+ for (qp = list->q_forw; qp != list; qp = qp->q_forw) {
free_shiplist(&head);
plp = (struct plist *)qp;
if ((plp->pcp->pl_flags & P_C) && (!(plp->pcp->pl_flags & P_T)))
}
(void)sprintf(prompt, "%s, %d bombs. Target ('~' to skip)? ",
prplane(&plp->plane), plp->bombs);
- ignore = 0;
shipno = -1;
- while (shipno < 0 && !player->aborted && !ignore) {
- if ((q = getstring(prompt, buf)) == 0 || *q == 0)
- continue;
- if (*q == '~') {
- ignore = 1;
+ while (shipno < 0) {
+ if ((q = getstring(prompt, buf)) == 0)
+ goto out;
+ if (*q == 0)
continue;
- }
+ if (*q == '~')
+ break;
if (*q == '?') {
if (plp->pcp->pl_flags & P_A)
print_shiplist(head);
}
collateral_damage(target->sct_x, target->sct_y, dam / 2);
}
+out:
free_shiplist(&head);
}
struct plnstr plane;
struct emp_qelem *qp;
int planeno;
- int ignore;
struct plist *plp;
char prompt[128];
char buf[1024];
(void)sprintf(prompt, "%s, %d bombs. Target ('~' to skip)? ",
prplane(&plp->plane), plp->bombs);
planeno = -1;
- ignore = 0;
- while (planeno < 0 && !player->aborted && !ignore) {
- if ((q = getstring(prompt, buf)) == 0 || *q == 0)
- continue;
- if (*q == '~') {
- ignore = 1;
+ while (planeno < 0) {
+ if ((q = getstring(prompt, buf)) == 0)
+ return;
+ if (*q == 0)
continue;
- }
+ if (*q == '~')
+ break;
if (*q == '?') {
planesatxy(target->sct_x, target->sct_y, 0, 0);
continue;
struct lndstr land;
struct emp_qelem *qp;
int unitno;
- int ignore, aaf, flak, hitchance;
+ int aaf, flak, hitchance;
struct plist *plp;
int nukedam;
int nunits;
(void)sprintf(prompt, "%s, %d bombs. Target ('~' to skip)? ",
prplane(&plp->plane), plp->bombs);
unitno = -1;
- ignore = 0;
- while (unitno < 0 && !player->aborted && !ignore) {
- if ((q = getstring(prompt, buf)) == 0 || *q == 0)
- continue;
- if (*q == '~') {
- ignore = 1;
+ while (unitno < 0) {
+ if ((q = getstring(prompt, buf)) == 0)
+ return;
+ if (*q == 0)
continue;
- }
+ if (*q == '~')
+ break;
if (*q == '?') {
unitsatxy(target->sct_x, target->sct_y, 0, 0);
continue;