Skip to content

Commit

Permalink
fix: failing to eject an unheld item is an illegal state
Browse files Browse the repository at this point in the history
  • Loading branch information
azaleacolburn committed Dec 12, 2024
1 parent 390a19c commit f6b476d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/lib/ActionInputStateMachine.svelte.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ export class ActionInputVerifier {
else if (action.includes('EjectBalloon')) this.held_balloons--;
else if (action.includes('EjectBunny')) this.held_bunnies--;
else if (action.includes('EjectTote')) this.held_totes--;
} else {
if (action.includes('EjectBalloon') && this.held_balloons <= 0) return false;
else if (action.includes('EjectBunny') && this.held_bunnies <= 0) return false;
else if (action.includes('EjectTote') && this.held_totes <= 0) return false;
}
if (action.includes('ScoreBalloon')) this.held_balloons--;
else if (action.includes('ScoreBunny')) this.held_bunnies--;
Expand Down

0 comments on commit f6b476d

Please sign in to comment.