Don't let embarked land units fight a che revolt

When take_casualties() kills a land unit, it neglects to take it off
its carrier.  This triggers an oops in unit_cargo_init().  Instead of
fixing this, just don't let them fight.  They can't defend against
other attacks, either.
This commit is contained in:
Markus Armbruster 2010-05-13 20:12:19 +02:00
parent 10f5000aa1
commit 93d033cff4

View file

@ -164,6 +164,8 @@ guerrilla(struct sctstr *sp)
while (NULL != (lp = nxtitemp(&ni))) {
if (lp->lnd_own != sp->sct_own)
continue;
if (lp->lnd_ship >= 0 || lp->lnd_land >= 0)
continue;
mil += lp->lnd_item[I_MILIT];
@ -441,6 +443,8 @@ take_casualties(struct sctstr *sp, int mc)
while (NULL != (lp = nxtitemp(&ni))) {
if (lp->lnd_own != sp->sct_own)
continue;
if (lp->lnd_ship >= 0 || lp->lnd_land >= 0)
continue;
nunits++;
if (lchr[(int)lp->lnd_type].l_flags & L_SECURITY)
nunits++;
@ -456,6 +460,8 @@ take_casualties(struct sctstr *sp, int mc)
while (NULL != (lp = nxtitemp(&ni))) {
if (lp->lnd_own != sp->sct_own)
continue;
if (lp->lnd_ship >= 0 || lp->lnd_land >= 0)
continue;
if (!(lchr[(int)lp->lnd_type].l_flags & L_SECURITY))
continue;
@ -483,6 +489,8 @@ take_casualties(struct sctstr *sp, int mc)
while (NULL != (lp = nxtitemp(&ni))) {
if (lp->lnd_own != sp->sct_own)
continue;
if (lp->lnd_ship >= 0 || lp->lnd_land >= 0)
continue;
if (lchr[(int)lp->lnd_type].l_flags & L_SECURITY)
continue;
@ -511,6 +519,8 @@ take_casualties(struct sctstr *sp, int mc)
while (NULL != (lp = nxtitemp(&ni))) {
if (lp->lnd_own != sp->sct_own)
continue;
if (lp->lnd_ship >= 0 || lp->lnd_land >= 0)
continue;
if (lchr[(int)lp->lnd_type].l_flags & L_SECURITY)
continue;
@ -531,6 +541,8 @@ take_casualties(struct sctstr *sp, int mc)
while (NULL != (lp = nxtitemp(&ni))) {
if (lp->lnd_own != sp->sct_own)
continue;
if (lp->lnd_ship >= 0 || lp->lnd_land >= 0)
continue;
if (!(lchr[(int)lp->lnd_type].l_flags & L_SECURITY))
continue;