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:
parent
6de86720b2
commit
d7671e297a
1 changed files with 4 additions and 3 deletions
|
@ -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));
|
||||
}
|
||||
|
||||
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)
|
||||
* (1 - techfact(pp->pln_tech, 1.0)))) {
|
||||
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;
|
||||
}
|
||||
|
||||
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 (type != EF_PLANE)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue