Skip to content

Commit

Permalink
Fix end of day check
Browse files Browse the repository at this point in the history
  • Loading branch information
Golen87 committed Aug 17, 2024
1 parent 7a2f085 commit f3c08a5
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/scenes/GameScene.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ export class GameScene extends BaseScene {

this.ui = new UI(this);
this.ui.setDepth(1000);
this.ui.setMoney(this.money);
this.ui.on("nextDay", () => {
this.startDay();
});
Expand Down Expand Up @@ -108,7 +109,11 @@ export class GameScene extends BaseScene {
delay: 5000,
callback: () => {
// Spawn new customer if shop is still open
if (this.state == GameState.Day && this.getAvailableWaitingSeat()) {
if (
this.state == GameState.Day &&
this.timeOfDay > 0 &&
this.getAvailableWaitingSeat()
) {
this.addCustomer();
}
},
Expand Down

0 comments on commit f3c08a5

Please sign in to comment.