Fix launch not to wipe out target ship updates

Ships can expend shells to defend against missiles, in
shp_missile_defense().  Any shell use by the target ship got wiped out
when launch_missile() wrote back the target ship, triggering a seqno
mismatch oops.

Fix by re-reading the target ship.
This commit is contained in:
Markus Armbruster 2009-12-26 11:28:25 +01:00
parent de5c0b1c6b
commit 7dc130b7ac

View file

@ -276,6 +276,7 @@ launch_missile(struct plnstr *pp)
target_ship.shp_x, target_ship.shp_y, target_ship.shp_x, target_ship.shp_y,
target_ship.shp_own, &sublaunch) < 0) target_ship.shp_own, &sublaunch) < 0)
return RET_OK; return RET_OK;
getship(n, &target_ship);
if (!msl_hit(pp, shp_hardtarget(&target_ship), EF_SHIP, if (!msl_hit(pp, shp_hardtarget(&target_ship), EF_SHIP,
N_SHP_MISS, N_SHP_SMISS, sublaunch, N_SHP_MISS, N_SHP_SMISS, sublaunch,
target_ship.shp_own)) { target_ship.shp_own)) {