load lload: Drop dead "cannot carry land units" checks

load_land_ship() and load_land_land() fail for carriers that can't
carry any land units before prompting for land units to load.  They
then iterate over land units to load, and fail when the carrrier has
no room.  They either report "cannot carry land units" or "doesn't
have room for any more land units" then.  The former cannot happen.
Crept into load_land_ship() in Empire 2, blindly copied to
load_land_land() in 4.0.0.  load_plane_ship() and load_plane_land()
don't have this issue.

Drop the dead code.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
This commit is contained in:
Markus Armbruster 2018-05-01 09:19:43 +02:00
parent 0851761fb9
commit 7c5e6e7f6d

View file

@ -30,7 +30,7 @@
* David Sharnoff, 1987 * David Sharnoff, 1987
* Ken Stevens, 1995 (rewritten) * Ken Stevens, 1995 (rewritten)
* Steve McClure, 1998-2000 * Steve McClure, 1998-2000
* Markus Armbruster, 2004-2017 * Markus Armbruster, 2004-2018
*/ */
#include <config.h> #include <config.h>
@ -600,13 +600,9 @@ load_land_ship(struct sctstr *sectp, struct shpstr *sp, int noisy,
load_spy = 1; load_spy = 1;
} }
if (!load_spy && shp_nland(sp) >= mchr[sp->shp_type].m_nland) { if (!load_spy && shp_nland(sp) >= mchr[sp->shp_type].m_nland) {
if (noisy) { if (noisy)
if (mchr[(int)sp->shp_type].m_nland) pr("%s doesn't have room for any more land units!\n",
pr("%s doesn't have room for any more land units!\n", prship(sp));
prship(sp));
else
pr("%s cannot carry land units!\n", prship(sp));
}
return 0; return 0;
} }
sprintf(buf, "loaded on your %s at %s", sprintf(buf, "loaded on your %s at %s",
@ -950,13 +946,9 @@ load_land_land(struct sctstr *sectp, struct lndstr *lp, int noisy,
/* Fit unit on ship */ /* Fit unit on ship */
if (loading) { if (loading) {
if (lnd_nland(lp) >= lchr[lp->lnd_type].l_nland) { if (lnd_nland(lp) >= lchr[lp->lnd_type].l_nland) {
if (noisy) { if (noisy)
if (lchr[lp->lnd_type].l_nland) pr("%s doesn't have room for any more land units!\n",
pr("%s doesn't have room for any more land units!\n", prland(lp));
prland(lp));
else
pr("%s cannot carry land units!\n", prland(lp));
}
break; break;
} }
sprintf(buf, "loaded on your %s at %s", sprintf(buf, "loaded on your %s at %s",