Skip to content

Commit

Permalink
Fix scheduled bulk upgrades checking for wrong tick
Browse files Browse the repository at this point in the history
  • Loading branch information
SpacialCircumstances committed Jul 16, 2024
1 parent 6724a15 commit f7ad444
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions server/services/scheduleBuy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export default class ScheduleBuyService extends EventEmitter {
for (let player of game.galaxy.players) {
if (player.scheduledActions.length == 0) continue;
const currentActions = player.scheduledActions
.filter(a => a.tick == game.state.tick - 1) // Tick number that we just finished
.filter(a => a.tick == game.state.tick) // Tick number that we just finished
.sort((a, b) => {
// Take the defined priorities
// We sort in the order totalCredits, belowPrice, infrastructureAmount, percentageOfCredits
Expand Down Expand Up @@ -106,7 +106,7 @@ export default class ScheduleBuyService extends EventEmitter {
}

_repeatOrRemoveAction(game: Game, actions: PlayerScheduledActions[]) {
const tick = game.state.tick - 1;
const tick = game.state.tick;

for (let i = 0; i < actions.length; i++) {
const action = actions[i]
Expand Down

0 comments on commit f7ad444

Please sign in to comment.