Commit
7ca4f412 fixed tracking of planes flying a sortie by marking
them with flag PLN_LAUNCHED. It failed to write SAMs and planes
flying missions back to the plane file, in sam_intercept() and
mission_pln_arm(). The only known problem with that is fairly
harmless: when the mission damages planes on the ground, the planes
flying it get damaged as if they were still sitting in their bases,
but the damage gets wiped out when they land.
The same issue applies to missiles. So they need to be tracked as
well. Do that in msl_hit().
While there, remove a few redundant PLN_LAUNCHED sanity checks.
free(dqp);
continue;
}
- if (mission_pln_equip(dplp, 0, P_F, 0) < 0) {
+ if (CANT_HAPPEN(dplp->plane.pln_flags & PLN_LAUNCHED)
+ || mission_pln_equip(dplp, 0, P_F, 0) < 0) {
emp_remque(dqp);
free(dqp);
continue;
}
- CANT_HAPPEN(dplp->plane.pln_flags & PLN_LAUNCHED);
dplp->plane.pln_flags |= PLN_LAUNCHED;
+ putplane(dplp->plane.pln_uid, &dplp->plane);
if (first) {
first = 0;
PR(plane_owner, "%s launches SAMs!\n", cname(def_own));
mission_flags &= ~P_MINE;
}
- CANT_HAPPEN(pp->pln_flags & PLN_LAUNCHED);
pp->pln_flags |= PLN_LAUNCHED;
pp->pln_mobil -= pln_mobcost(dist, pp, flags);
+ putplane(pp->pln_uid, pp);
}
return mission_flags;
}
return 0;
}
+ CANT_HAPPEN(pp->pln_flags & PLN_LAUNCHED);
+ pp->pln_flags |= PLN_LAUNCHED;
+ putplane(pp->pln_uid, pp);
mpr(pp->pln_own, "\tSHWOOOOOSH! Missile launched!\n");
if (pp->pln_nuketype != -1)
mission_flags &= ~P_MINE;
/* FIXME no effect */
}
- CANT_HAPPEN(pp->pln_flags & PLN_LAUNCHED);
pp->pln_flags |= PLN_LAUNCHED;
pp->pln_mobil -= pln_mobcost(dist, pp, flags);
putplane(pp->pln_uid, pp);