Fix cargo giveaway in scrap and scuttle

When giving away cargo by scrapping or scuttling its carrier, the
cargo's cargo wasn't given away.  Happened for instance when a ship
carrying a land unit carrying a SAM got scrapped.

Also, wing, army and mission weren't cleared.

To fix, create unit_give_away() and use it in unit_drop_cargo().
This commit is contained in:
Markus Armbruster 2008-09-13 22:06:44 -04:00
parent f3651f17e5
commit d2b1bef0f5
2 changed files with 39 additions and 7 deletions

View file

@ -58,3 +58,4 @@ 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);
extern void unit_give_away(struct empobj *, natid, natid);