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

@ -57,3 +57,4 @@ extern void unit_put(struct emp_qelem *list, natid actor);
extern char *unit_path(int, struct empobj *, char *);
extern void unit_view(struct emp_qelem *);
extern void unit_update_cargo(struct empobj *);
extern void unit_drop_cargo(struct empobj *, natid);