guerrilla() lets only the sector owner's land units fight. But
take_casualties() spread the casualties among all land units in the
sector. Thus, defending land units could survive a defeat if foreign
land units were present. The sector takeover then had che capture
them, or their crews blow them up. The foreign land units were
damaged silently.
*/
snxtitem_xy(&ni, EF_LAND, sp->sct_x, sp->sct_y);
while (NULL != (lp = nxtitemp(&ni))) {
*/
snxtitem_xy(&ni, EF_LAND, sp->sct_x, sp->sct_y);
while (NULL != (lp = nxtitemp(&ni))) {
+ if (lp->lnd_own != sp->sct_own)
+ continue;
nunits++;
if (lchr[(int)lp->lnd_type].l_flags & L_SECURITY)
nunits++;
nunits++;
if (lchr[(int)lp->lnd_type].l_flags & L_SECURITY)
nunits++;
/* kill some security troops */
snxtitem_xy(&ni, EF_LAND, sp->sct_x, sp->sct_y);
while (NULL != (lp = nxtitemp(&ni))) {
/* kill some security troops */
snxtitem_xy(&ni, EF_LAND, sp->sct_x, sp->sct_y);
while (NULL != (lp = nxtitemp(&ni))) {
+ if (lp->lnd_own != sp->sct_own)
+ continue;
if (!(lchr[(int)lp->lnd_type].l_flags & L_SECURITY))
continue;
if (!(lchr[(int)lp->lnd_type].l_flags & L_SECURITY))
continue;
/* kill some normal troops */
snxtitem_xy(&ni, EF_LAND, sp->sct_x, sp->sct_y);
while (NULL != (lp = nxtitemp(&ni))) {
/* kill some normal troops */
snxtitem_xy(&ni, EF_LAND, sp->sct_x, sp->sct_y);
while (NULL != (lp = nxtitemp(&ni))) {
+ if (lp->lnd_own != sp->sct_own)
+ continue;
if (lchr[(int)lp->lnd_type].l_flags & L_SECURITY)
continue;
if (lchr[(int)lp->lnd_type].l_flags & L_SECURITY)
continue;
/* kill some normal troops */
snxtitem_xy(&ni, EF_LAND, sp->sct_x, sp->sct_y);
while (NULL != (lp = nxtitemp(&ni))) {
/* kill some normal troops */
snxtitem_xy(&ni, EF_LAND, sp->sct_x, sp->sct_y);
while (NULL != (lp = nxtitemp(&ni))) {
+ if (lp->lnd_own != sp->sct_own)
+ continue;
if (lchr[(int)lp->lnd_type].l_flags & L_SECURITY)
continue;
if (lchr[(int)lp->lnd_type].l_flags & L_SECURITY)
continue;
/* kill some security troops */
snxtitem_xy(&ni, EF_LAND, sp->sct_x, sp->sct_y);
while (NULL != (lp = nxtitemp(&ni))) {
/* kill some security troops */
snxtitem_xy(&ni, EF_LAND, sp->sct_x, sp->sct_y);
while (NULL != (lp = nxtitemp(&ni))) {
+ if (lp->lnd_own != sp->sct_own)
+ continue;
if (!(lchr[(int)lp->lnd_type].l_flags & L_SECURITY))
continue;
if (!(lchr[(int)lp->lnd_type].l_flags & L_SECURITY))
continue;