From f6b476d67f68e7b5dfaa2c84d1540afab5b3b2bd Mon Sep 17 00:00:00 2001 From: Azalea Colburn Date: Thu, 12 Dec 2024 09:58:56 -0800 Subject: [PATCH] fix: failing to eject an unheld item is an illegal state --- src/lib/ActionInputStateMachine.svelte.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/lib/ActionInputStateMachine.svelte.ts b/src/lib/ActionInputStateMachine.svelte.ts index ef32586..2a47bd0 100644 --- a/src/lib/ActionInputStateMachine.svelte.ts +++ b/src/lib/ActionInputStateMachine.svelte.ts @@ -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--;