Skip to content

Commit

Permalink
fix governor's over-enthusiastic mass ejection policy
Browse files Browse the repository at this point in the history
  • Loading branch information
Daxtorim authored and Fabian Preuß committed Jul 29, 2023
1 parent 99de001 commit 3cb6655
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion evolve/main.js

Large diffs are not rendered by default.

9 changes: 5 additions & 4 deletions src/governor.js
Original file line number Diff line number Diff line change
Expand Up @@ -1103,10 +1103,11 @@ export const gov_tasks = {
if (craft > 0){ craft = 0; }

if (global.race.governor.config.trash[res] || global.interstellar.mass_ejector.hasOwnProperty(res) && global.resource[res].display && global.resource[res].max > 0 && global.interstellar.mass_ejector[res] + global.resource[res].diff > 0 && global.resource[res].amount + trade - craft >= global.resource[res].max * 0.999 - 1){
let set = (global.resource[res].amount + trade - craft >= global.resource[res].max * 0.999 - 1) || (global.race.governor.config.trash[res] && !global.race.governor.config.trash[res].s)
? Math.floor(global.interstellar.mass_ejector[res] + global.resource[res].diff)
: 0;

let set = 0;
if ((global.resource[res].amount + trade - craft >= global.resource[res].max * 0.999 - 1) || (global.race.governor.config.trash[res] && !global.race.governor.config.trash[res].s)) {
const diff = Math.floor(global.resource[res].diff / global.settings.gameSpeed);
set = global.interstellar.mass_ejector[res] + diff;
}
if (global.race.governor.config.trash[res] && set < global.race.governor.config.trash[res].v && global.race.governor.config.trash[res].s){
set = Math.abs(global.race.governor.config.trash[res].v);
}
Expand Down
2 changes: 1 addition & 1 deletion wiki/wiki.js

Large diffs are not rendered by default.

0 comments on commit 3cb6655

Please sign in to comment.