Check plane efficiency and capabilities earlier in pln_sel()

This way we don't complain about range to assembly point and
destination for planes that can't go regardless.
This commit is contained in:
Markus Armbruster 2008-03-24 08:04:10 +01:00
parent 9e0950456d
commit ce7ab95c3b

View file

@ -504,6 +504,13 @@ pln_sel(struct nstr_item *ni, struct emp_qelem *list, struct sctstr *ap,
continue;
if (plane.pln_mobil <= 0)
continue;
if (plane.pln_effic < 40) {
pr("%s not efficient enough (must be 40%%)\n",
prplane(&plane));
continue;
}
if (!pln_capable(&plane, wantflags, nowantflags))
continue;
if (opt_MARKET) {
if (ontradingblock(EF_PLANE, &plane)) {
pr("plane #%d inelligible - it's for sale.\n",
@ -517,16 +524,9 @@ pln_sel(struct nstr_item *ni, struct emp_qelem *list, struct sctstr *ap,
pr("%s too far from assembly point\n", prplane(&plane));
continue;
}
if (plane.pln_effic < 40) {
pr("%s not efficient enough (must be 40%%)\n",
prplane(&plane));
continue;
}
range += ap_to_target;
range *= rangemult;
pcp = &plchr[(int)plane.pln_type];
if (!pln_capable(&plane, wantflags, nowantflags))
continue;
if (plane.pln_range < range) {
pr("%s out of range (%d:%d)\n",
prplane(&plane), plane.pln_range, range);