load: Drop dead recomputation of load_spy
load_land_ship() recomputes load_spy "since [the carrier] may have changed". Has been that way since the feature was added in 4.2.0, but it's nonsense. Drop it. Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
This commit is contained in:
parent
7c5e6e7f6d
commit
93d842de20
1 changed files with 8 additions and 11 deletions
|
@ -589,21 +589,18 @@ load_land_ship(struct sctstr *sectp, struct shpstr *sp, int noisy,
|
||||||
}
|
}
|
||||||
/* Fit unit on ship */
|
/* Fit unit on ship */
|
||||||
if (loading) {
|
if (loading) {
|
||||||
/* We have to check again, since it may have changed */
|
if (load_spy) {
|
||||||
if ((mchr[(int)sp->shp_type].m_flags & M_SUB) &&
|
|
||||||
(mchr[(int)sp->shp_type].m_nland == 0)) {
|
|
||||||
if (shp_nland(sp) >= 2) {
|
if (shp_nland(sp) >= 2) {
|
||||||
pr("Non-land unit carrying subs can only carry up to two spy units.\n");
|
pr("Non-land unit carrying subs can only carry up to two spy units.\n");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
/* Eh, let 'em load a spy only */
|
} else {
|
||||||
load_spy = 1;
|
if (shp_nland(sp) >= mchr[sp->shp_type].m_nland) {
|
||||||
}
|
if (noisy)
|
||||||
if (!load_spy && shp_nland(sp) >= mchr[sp->shp_type].m_nland) {
|
pr("%s doesn't have room for any more land units!\n",
|
||||||
if (noisy)
|
prship(sp));
|
||||||
pr("%s doesn't have room for any more land units!\n",
|
return 0;
|
||||||
prship(sp));
|
}
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
sprintf(buf, "loaded on your %s at %s",
|
sprintf(buf, "loaded on your %s at %s",
|
||||||
prship(sp), xyas(sp->shp_x, sp->shp_y, sp->shp_own));
|
prship(sp), xyas(sp->shp_x, sp->shp_y, sp->shp_own));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue