update: Fix avail roll over for stopped or broke sectors
People don't work when their sector is stopped or their nation is
broke. Implemented by produce_sect() skipping the assignment of new
work returned by do_feed() to sct_avail.
This is wrong because it lets all old work roll over, ignoring
rollover_avail_max.
Broken in 4.0.0. Similarly broken for sectors disabled via zero
budget priority between a botched fix for changing sector types in
Chainsaw and the removal of budget priorities in commit 520446e
,
v4.3.6.
Fix by zapping available work when the sector is stopped or its owner
is broke.
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
This commit is contained in:
parent
6fcbc16adf
commit
8e246ee06d
3 changed files with 5 additions and 5 deletions
|
@ -223,7 +223,7 @@ void
|
|||
produce_sect(struct natstr *np, int etu, struct bp *bp, int p_sect[][2])
|
||||
{
|
||||
struct sctstr *sp, scratch_sect;
|
||||
int work, cost, ecost, pcost;
|
||||
int cost, ecost, pcost;
|
||||
int n, amount;
|
||||
|
||||
for (n = 0; NULL != (sp = getsectid(n)); n++) {
|
||||
|
@ -249,14 +249,14 @@ produce_sect(struct natstr *np, int etu, struct bp *bp, int p_sect[][2])
|
|||
sp = &scratch_sect;
|
||||
}
|
||||
|
||||
work = do_feed(sp, np, etu, 0);
|
||||
sp->sct_avail = do_feed(sp, np, etu, 0);
|
||||
|
||||
if (sp->sct_off || np->nat_money < 0) {
|
||||
sp->sct_avail = 0;
|
||||
bp_set_from_sect(bp, sp);
|
||||
continue;
|
||||
}
|
||||
|
||||
sp->sct_avail = work;
|
||||
amount = 0;
|
||||
pcost = cost = ecost = 0;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue