Skip to content

Commit

Permalink
fix logic for changing day
Browse files Browse the repository at this point in the history
  • Loading branch information
xjyribro committed Apr 21, 2024
1 parent a4d74d9 commit dbb013f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/game/ui/hud/clock.dart
Original file line number Diff line number Diff line change
Expand Up @@ -118,14 +118,14 @@ class ClockComponent extends HudMarginComponent {
if (_seconds > gameMinToRealSecond) {
_seconds = 0;
_gameMins += 1;
_timeCheck();
_respawnRubbishCheck();
if (_gameMins > minsInADay) {
_gameMins = 0;
_game.gameStateBloc.add(const SetMinsInGame(0));
} else {
_game.gameStateBloc.add(const AddOneMin());
}
_timeCheck();
_respawnRubbishCheck();
}
final int hours = (_gameMins / 60).floor();
final int mins = _gameMins % 60;
Expand Down

0 comments on commit dbb013f

Please sign in to comment.