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])
|
produce_sect(struct natstr *np, int etu, struct bp *bp, int p_sect[][2])
|
||||||
{
|
{
|
||||||
struct sctstr *sp, scratch_sect;
|
struct sctstr *sp, scratch_sect;
|
||||||
int work, cost, ecost, pcost;
|
int cost, ecost, pcost;
|
||||||
int n, amount;
|
int n, amount;
|
||||||
|
|
||||||
for (n = 0; NULL != (sp = getsectid(n)); n++) {
|
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;
|
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) {
|
if (sp->sct_off || np->nat_money < 0) {
|
||||||
|
sp->sct_avail = 0;
|
||||||
bp_set_from_sect(bp, sp);
|
bp_set_from_sect(bp, sp);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
sp->sct_avail = work;
|
|
||||||
amount = 0;
|
amount = 0;
|
||||||
pcost = cost = ecost = 0;
|
pcost = cost = ecost = 0;
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,7 @@ owner xloc yloc des effic mobil off loyal terr0 terr1 terr2 terr3 dterr xdist yd
|
||||||
1 11 1 24 13 120 0 6 0 0 0 0 0 11 1 12 0 0 0 24 0 0 0 0 0 1 34 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 0 0 0 0 0 0 0
|
1 11 1 24 13 120 0 6 0 0 0 0 0 11 1 12 0 0 0 24 0 0 0 0 0 1 34 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 0 0 0 0 0 0 0
|
||||||
1 13 1 15 100 120 0 0 0 0 0 0 0 13 1 0 0 100 0 15 0 0 100 0 0 1 34 0 0 0 0 0 0 0 165 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 0 0 0 0 0 0 0
|
1 13 1 15 100 120 0 0 0 0 0 0 0 13 1 0 0 100 0 15 0 0 100 0 0 1 34 0 0 0 0 0 0 0 165 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 0 0 0 0 0 0 0
|
||||||
1 15 1 15 100 120 0 3 0 0 0 0 0 15 1 0 0 0 1 15 0 0 100 0 0 1 0 34 0 0 0 0 0 0 99 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 0 0 0 0 0 0 0
|
1 15 1 15 100 120 0 3 0 0 0 0 0 15 1 0 0 0 1 15 0 0 100 0 0 1 0 34 0 0 0 0 0 0 99 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 0 0 0 0 0 0 0
|
||||||
2 -15 1 5 100 120 0 0 0 0 0 0 0 -15 1 100 0 100 1 5 0 0 0 0 0 2 130 0 0 0 0 0 0 0 97 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 0 0 0 0 0 0 0
|
2 -15 1 5 100 120 0 0 0 0 0 0 0 -15 1 0 0 100 1 5 0 0 0 0 0 2 130 0 0 0 0 0 0 0 97 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 0 0 0 0 0 0 0
|
||||||
2 -13 1 5 100 120 0 0 0 0 0 0 0 -13 1 0 0 100 0 5 0 0 0 0 0 2 130 0 0 0 0 0 0 0 97 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 0 0 0 0 0 0 0
|
2 -13 1 5 100 120 0 0 0 0 0 0 0 -13 1 0 0 100 0 5 0 0 0 0 0 2 130 0 0 0 0 0 0 0 97 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 0 0 0 0 0 0 0
|
||||||
2 -11 1 5 100 120 0 0 0 0 0 0 0 -11 1 0 0 100 0 5 0 0 0 0 0 2 130 0 0 0 0 0 0 0 97 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 0 0 0 0 0 0 0
|
2 -11 1 5 100 120 0 0 0 0 0 0 0 -11 1 0 0 100 0 5 0 0 0 0 0 2 130 0 0 0 0 0 0 0 97 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 0 0 0 0 0 0 0
|
||||||
2 -9 1 5 100 120 0 0 0 0 0 0 0 -9 1 0 0 100 0 5 0 0 0 0 0 2 130 0 0 0 0 0 0 0 97 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 0 0 0 0 0 0 0
|
2 -9 1 5 100 120 0 0 0 0 0 0 0 -9 1 0 0 100 0 5 0 0 0 0 0 2 130 0 0 0 0 0 0 0 97 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 0 0 0 0 0 0 0
|
||||||
|
|
|
@ -929,7 +929,7 @@
|
||||||
Play#0 output Play#0 1 2 -6,0 - 0% 120 .. .. 130 0 0 96 100% 0 0
|
Play#0 output Play#0 1 2 -6,0 - 0% 120 .. .. 130 0 0 96 100% 0 0
|
||||||
Play#0 output Play#0 1 2 -4,0 - 0% 120 .. .. 130 0 0 97 100% 0 0
|
Play#0 output Play#0 1 2 -4,0 - 0% 120 .. .. 130 0 0 97 100% 0 0
|
||||||
Play#0 output Play#0 1 2 -2,0 c 10% 120 .. .. 130 0 0 97 100% 0 0
|
Play#0 output Play#0 1 2 -2,0 c 10% 120 .. .. 130 0 0 97 100% 0 0
|
||||||
Play#0 output Play#0 1 2 -15,1 c 100% 120 .. .. 130 0 0 97 100% 100 0 1
|
Play#0 output Play#0 1 2 -15,1 c 100% 120 .. .. 130 0 0 97 100% 0 0 1
|
||||||
Play#0 output Play#0 1 2 -13,1 c 100% 120 .. .. 130 0 0 97 100% 0 0
|
Play#0 output Play#0 1 2 -13,1 c 100% 120 .. .. 130 0 0 97 100% 0 0
|
||||||
Play#0 output Play#0 1 2 -11,1 c 100% 120 .. .. 130 0 0 97 100% 0 0
|
Play#0 output Play#0 1 2 -11,1 c 100% 120 .. .. 130 0 0 97 100% 0 0
|
||||||
Play#0 output Play#0 1 2 -9,1 c 100% 120 .. .. 130 0 0 97 100% 0 0
|
Play#0 output Play#0 1 2 -9,1 c 100% 120 .. .. 130 0 0 97 100% 0 0
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue