Fix and enable collateral damage for missing missiles

Collateral damage was disabled, because after msl_hit() reported a
miss, the missile may or may not have reached the target.

Fix by splitting msl_launch() off msl_hit().

Drop the disabled collateral damage code for sector targets, because
sectors can't be missed.  Enable it for ships and land units.

Since msl_launch() returns whether the missile is sub-launched, drop
launch_missile() parameter sublaunch, and simplify its caller.
This commit is contained in:
Markus Armbruster 2009-10-11 12:04:16 -04:00
parent e7fec28009
commit fd894d9864
6 changed files with 66 additions and 81 deletions

View file

@ -492,8 +492,9 @@ extern int move_ground(struct sctstr *, struct sctstr *,
int, int *);
extern int fly_map(coord, coord);
/* mslsub.c */
extern int msl_hit(struct plnstr *, int, int, int, int, char *,
coord, coord, int);
extern int msl_launch(struct plnstr *, int, char *, coord, coord, natid,
int *);
extern int msl_hit(struct plnstr *, int, int, int, int, int, natid);
extern void msl_sel(struct emp_qelem *, coord, coord, natid, int,
int, int);
extern int msl_abm_intercept(struct plnstr *, coord, coord, int);