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:
parent
612ec6257d
commit
3d3d272eef
3 changed files with 8 additions and 3 deletions
|
@ -54,6 +54,7 @@ extern void finish_server(void);
|
||||||
* src/lib/commands/ *.c
|
* src/lib/commands/ *.c
|
||||||
*/
|
*/
|
||||||
extern int check_market(void);
|
extern int check_market(void);
|
||||||
|
extern int load_comm_ok(struct sctstr *, natid, i_type, int);
|
||||||
extern void gift(natid, natid, void *, char *);
|
extern void gift(natid, natid, void *, char *);
|
||||||
extern int display_mark(i_type, int);
|
extern int display_mark(i_type, int);
|
||||||
extern int want_to_abandon(struct sctstr *, i_type, int, struct lndstr *);
|
extern int want_to_abandon(struct sctstr *, i_type, int, struct lndstr *);
|
||||||
|
|
|
@ -337,7 +337,7 @@ move_amount(int sect_amt, int unit_amt, int unit_max,
|
||||||
return move_amt;
|
return move_amt;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
int
|
||||||
load_comm_ok(struct sctstr *sectp, natid unit_own,
|
load_comm_ok(struct sctstr *sectp, natid unit_own,
|
||||||
i_type item, int move_amt)
|
i_type item, int move_amt)
|
||||||
{
|
{
|
||||||
|
|
|
@ -142,6 +142,8 @@ scra(void)
|
||||||
eff = item.ship.shp_effic / 100.0;
|
eff = item.ship.shp_effic / 100.0;
|
||||||
mp = &mchr[(int)item.ship.shp_type];
|
mp = &mchr[(int)item.ship.shp_type];
|
||||||
for (i = I_NONE + 1; i <= I_MAX; i++) {
|
for (i = I_NONE + 1; i <= I_MAX; i++) {
|
||||||
|
if (load_comm_ok(§, item.ship.shp_own, i,
|
||||||
|
-item.ship.shp_item[i]))
|
||||||
sect.sct_item[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;
|
sect.sct_item[I_LCM] += mp->m_lcm * 2 / 3 * eff;
|
||||||
|
@ -150,6 +152,8 @@ scra(void)
|
||||||
eff = item.land.lnd_effic / 100.0;
|
eff = item.land.lnd_effic / 100.0;
|
||||||
lp = &lchr[(int)item.land.lnd_type];
|
lp = &lchr[(int)item.land.lnd_type];
|
||||||
for (i = I_NONE + 1; i <= I_MAX; i++) {
|
for (i = I_NONE + 1; i <= I_MAX; i++) {
|
||||||
|
if (load_comm_ok(§, item.land.lnd_own, i,
|
||||||
|
-item.land.lnd_item[i]))
|
||||||
sect.sct_item[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;
|
sect.sct_item[I_LCM] += lp->l_lcm * 2 / 3 * eff;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue