Refactor and fix scuttle and scrap code

Factor unit_drop_cargo() out of scra(), scuttle_ship(),
scuttle_land(), fix it up:

* Some messages were sent as bulletins instead of printing them.

* Nukes were always destroyed.  They're now treated exactly like other
  cargo.

* scuttle destroyed some cargo silently, and listed other cargo as
  "scuttled".  It now simply lets unit_update_cargo() running from
  carrier prewrite callbacks list all cargo "lost".

Simplify its callers.  scuttle_ship() and scuttle_land() are now
trivial, inline and remove.
This commit is contained in:
Markus Armbruster 2008-09-13 18:35:50 -04:00
parent 3318e4e4e5
commit f3651f17e5
6 changed files with 74 additions and 196 deletions

View file

@ -66,7 +66,6 @@ extern int do_unit_move(struct emp_qelem *land_list, int *together,
double *minmob, double *maxmob);
extern int count_pop(int);
extern int scuttle_tradeship(struct shpstr *, int);
extern void scuttle_ship(struct shpstr *);
extern void resnoise(struct sctstr *sptr, int public_amt, char *name,
int old, int new);
extern int line_of_sight(char **rad, int ax, int ay, int bx, int by);