Don't let scrap give away civilians

Scrapping unloads everything.  Even stuff that unload can't: foreign
civilians.  Kill them off instead, like scuttle does.
This commit is contained in:
Markus Armbruster 2012-06-30 21:21:49 +02:00
parent 612ec6257d
commit 3d3d272eef
3 changed files with 8 additions and 3 deletions

View file

@ -54,6 +54,7 @@ extern void finish_server(void);
* src/lib/commands/ *.c
*/
extern int check_market(void);
extern int load_comm_ok(struct sctstr *, natid, i_type, int);
extern void gift(natid, natid, void *, char *);
extern int display_mark(i_type, int);
extern int want_to_abandon(struct sctstr *, i_type, int, struct lndstr *);

View file

@ -337,7 +337,7 @@ move_amount(int sect_amt, int unit_amt, int unit_max,
return move_amt;
}
static int
int
load_comm_ok(struct sctstr *sectp, natid unit_own,
i_type item, int move_amt)
{

View file

@ -142,6 +142,8 @@ scra(void)
eff = item.ship.shp_effic / 100.0;
mp = &mchr[(int)item.ship.shp_type];
for (i = I_NONE + 1; i <= I_MAX; i++) {
if (load_comm_ok(&sect, item.ship.shp_own, i,
-item.ship.shp_item[i]))
sect.sct_item[i] += item.ship.shp_item[i];
}
sect.sct_item[I_LCM] += mp->m_lcm * 2 / 3 * eff;
@ -150,6 +152,8 @@ scra(void)
eff = item.land.lnd_effic / 100.0;
lp = &lchr[(int)item.land.lnd_type];
for (i = I_NONE + 1; i <= I_MAX; i++) {
if (load_comm_ok(&sect, item.land.lnd_own, i,
-item.land.lnd_item[i]))
sect.sct_item[i] += item.land.lnd_item[i];
}
sect.sct_item[I_LCM] += lp->l_lcm * 2 / 3 * eff;