update: Fix sector maintenance when stopped or broke
No maintenance is paid when the sector is stopped or the owner is
broke. Broken in commit 44c36fa
, v4.3.23. Fix it.
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
This commit is contained in:
parent
ac1a755e33
commit
f5c9e232e8
5 changed files with 20 additions and 20 deletions
|
@ -257,12 +257,6 @@ produce_sect(struct natstr *np, int etu, struct bp *bp)
|
|||
|
||||
do_feed(sp, np, etu, 0);
|
||||
|
||||
if (sp->sct_off || budget->money < 0) {
|
||||
sp->sct_avail = 0;
|
||||
bp_set_from_sect(bp, sp);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (dchr[sp->sct_type].d_maint) {
|
||||
cost = etu * dchr[sp->sct_type].d_maint;
|
||||
budget->bm[BUDG_SCT_MAINT].count++;
|
||||
|
@ -270,6 +264,12 @@ produce_sect(struct natstr *np, int etu, struct bp *bp)
|
|||
budget->money -= cost;
|
||||
}
|
||||
|
||||
if (sp->sct_off || budget->money < 0) {
|
||||
sp->sct_avail = 0;
|
||||
bp_set_from_sect(bp, sp);
|
||||
continue;
|
||||
}
|
||||
|
||||
if ((sp->sct_effic < 100 || sp->sct_type != sp->sct_newtype) &&
|
||||
budget->money >= 0) {
|
||||
cost = buildeff(sp);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue