Skip to content

Commit

Permalink
Add guard for adding lives
Browse files Browse the repository at this point in the history
  • Loading branch information
otacke committed Jan 7, 2024
1 parent 045efd7 commit 09674ce
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/scripts/components/mixins/main-handlers-stage.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { STAGE_TYPES } from '@components/map/stage/stage.js';
*/
export default class MainHandlersStage {
addExtraLives(amount) {
if (typeof amount !== 'number' || amount < 1) {
if (typeof amount !== 'number' || amount < 1 || this.livesLeft === Infinity) {
return;
}

Expand Down

0 comments on commit 09674ce

Please sign in to comment.