Fix harmless seqno mismatch in launch

When an inefficient missile exploded on launch, it could damage
itself.  The damage had no effect, because the missile gets used up
right after.  But it triggers a seqno mismatch oops, in laun().  Fix
by making msl_launch() set PLN_LAUNCHED before the explosion.

This case was missed in commit 7bc63871, v4.3.14.  It didn't oops
until sequence numbers were added in v4.3.15.
This commit is contained in:
Markus Armbruster 2010-04-18 19:05:52 +02:00
parent 6de86720b2
commit d7671e297a

View file

@ -91,6 +91,10 @@ msl_launch(struct plnstr *pp, int type, char *what, coord x, coord y,
mpr(pp->pln_own, "%s\n", xyas(pp->pln_x, pp->pln_y, pp->pln_own)); mpr(pp->pln_own, "%s\n", xyas(pp->pln_x, pp->pln_y, pp->pln_own));
} }
CANT_HAPPEN(pp->pln_flags & PLN_LAUNCHED);
pp->pln_flags |= PLN_LAUNCHED;
putplane(pp->pln_uid, pp);
if (chance((0.05 + (100 - pp->pln_effic) / 100.0) if (chance((0.05 + (100 - pp->pln_effic) / 100.0)
* (1 - techfact(pp->pln_tech, 1.0)))) { * (1 - techfact(pp->pln_tech, 1.0)))) {
mpr(pp->pln_own, "KABOOOOM! Missile explodes %s!\n", from); mpr(pp->pln_own, "KABOOOOM! Missile explodes %s!\n", from);
@ -115,9 +119,6 @@ msl_launch(struct plnstr *pp, int type, char *what, coord x, coord y,
return -1; return -1;
} }
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"); mpr(pp->pln_own, "\tSHWOOOOOSH! Missile launched!\n");
if (type != EF_PLANE) if (type != EF_PLANE)