(lnd_sel): The marching code gets confused when trains and non-trains
march together. Disallow for now. (lnd_mar_one_sector): Use lnd_mobtype() to check whether rail's needed.
This commit is contained in:
parent
db599368bc
commit
36e41e5ac9
1 changed files with 23 additions and 26 deletions
|
@ -474,15 +474,12 @@ lnd_count_units(struct lndstr *lp)
|
||||||
|
|
||||||
void
|
void
|
||||||
lnd_sel(struct nstr_item *ni, struct emp_qelem *list)
|
lnd_sel(struct nstr_item *ni, struct emp_qelem *list)
|
||||||
|
|
||||||
|
|
||||||
/* int wantflags;
|
|
||||||
int nowantflags;
|
|
||||||
*/
|
|
||||||
{
|
{
|
||||||
struct lndstr land;
|
struct lndstr land;
|
||||||
struct lchrstr *lcp;
|
struct lchrstr *lcp;
|
||||||
struct llist *llp;
|
struct llist *llp;
|
||||||
|
int this_mot;
|
||||||
|
int mobtype = MOB_MOVE; /* indeterminate */
|
||||||
|
|
||||||
emp_initque(list);
|
emp_initque(list);
|
||||||
while (nxtitem(ni, &land)) {
|
while (nxtitem(ni, &land)) {
|
||||||
|
@ -495,26 +492,26 @@ lnd_sel(struct nstr_item *ni, struct emp_qelem *list)
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
|
* The marching code gets confused when trains and non-trains
|
||||||
|
* march together. Disallow for now.
|
||||||
|
*/
|
||||||
|
this_mot = lnd_mobtype(&land);
|
||||||
|
if (this_mot != mobtype) {
|
||||||
|
if (mobtype == MOB_MOVE)
|
||||||
|
mobtype = this_mot;
|
||||||
|
else if (mobtype == MOB_MARCH) {
|
||||||
|
pr("%s is a train and can't march with the leader.\n",
|
||||||
|
prland(&land));
|
||||||
|
continue;
|
||||||
|
} else {
|
||||||
|
pr("%s can't rail-march with the leading train.\n",
|
||||||
|
prland(&land));
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
lcp = &lchr[(int)land.lnd_type];
|
lcp = &lchr[(int)land.lnd_type];
|
||||||
/* if (wantflags && (lcp->m_flags & wantflags) != wantflags)
|
|
||||||
continue;
|
|
||||||
if (nowantflags && lcp->m_flags & nowantflags)
|
|
||||||
continue;
|
|
||||||
*/
|
|
||||||
/* This abuse is better fixed by building a unit with the normal negative
|
|
||||||
mobility that everything else is built with */
|
|
||||||
/* Just so that the player can't build a bunch of land units, and them
|
|
||||||
march them a few minutes later... */
|
|
||||||
/*
|
|
||||||
if (opt_MOB_ACCESS) {
|
|
||||||
if (land.lnd_effic < 11 &&
|
|
||||||
land.lnd_mobil < etu_per_update) {
|
|
||||||
pr("Land unit #%d needs at least %d mob to march.\n",
|
|
||||||
land.lnd_uid, etu_per_update);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
land.lnd_mission = 0;
|
land.lnd_mission = 0;
|
||||||
land.lnd_rflags = 0;
|
land.lnd_rflags = 0;
|
||||||
land.lnd_harden = 0;
|
land.lnd_harden = 0;
|
||||||
|
@ -1073,8 +1070,8 @@ lnd_mar_one_sector(struct emp_qelem *list, int dir, natid actor,
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ((!intrchr[INT_RAIL].in_enable || sect.sct_rail == 0) &&
|
if ((!intrchr[INT_RAIL].in_enable || sect.sct_rail == 0)
|
||||||
lchr[(int)llp->land.lnd_type].l_flags & L_TRAIN) {
|
&& lnd_mobtype(&llp->land) == MOB_RAIL) {
|
||||||
if (together) {
|
if (together) {
|
||||||
pr("no rail system in %s\n", xyas(newx, newy, actor));
|
pr("no rail system in %s\n", xyas(newx, newy, actor));
|
||||||
return 1;
|
return 1;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue