Behave like plane_bomb() and land_bomb(): deal with leading whitespace
and signs in the input, print a message when asked to bomb a ship that
is not there.
shipsatxy(target->sct_x, target->sct_y, 0, M_SUB, 0);
continue;
}
- if (!isdigit(*q))
- continue;
n = atoi(q);
if (n < 0)
continue;
- if ((plp->pcp->pl_flags & P_A) && !on_shiplist(n, head))
- continue;
- if (getship(n, &ship) && ship.shp_own &&
+ if ((!(plp->pcp->pl_flags & P_A) || on_shiplist(n, head)) &&
+ getship(n, &ship) && ship.shp_own &&
ship.shp_x == target->sct_x && ship.shp_y == target->sct_y)
shipno = n;
+ else
+ pr("Ship #%d not spotted\n", n);
}
if (shipno < 0)
continue;