diff --git a/src/routes/scout/ActionInputs.svelte b/src/routes/scout/ActionInputs.svelte index f0a5cbf..8a191c4 100644 --- a/src/routes/scout/ActionInputs.svelte +++ b/src/routes/scout/ActionInputs.svelte @@ -29,15 +29,18 @@ actionState = `ScoreBalloon${where}`; } function complete(success: boolean) { - // Assume that the robot ejects even if they fail to score - if (actionState.includes('IntakeBalloon')) held_balloons++; - else if (actionState.includes('IntakeBunny')) held_bunnies++; - else if (actionState.includes('IntakeTote')) held_totes++; - else if (actionState.includes('ScoreBalloon')) held_balloons--; + // Assume that a failure means a note remains where it is + if (success) { + if (actionState.includes('IntakeBalloon')) held_balloons++; + else if (actionState.includes('IntakeBunny')) held_bunnies++; + else if (actionState.includes('IntakeTote')) held_totes++; + else if (actionState.includes('EjectBalloon')) held_balloons--; + else if (actionState.includes('EjectBunny')) held_bunnies--; + else if (actionState.includes('EjectTote')) held_totes--; + } + // Assume failed scoring is still ejecting + if (actionState.includes('ScoreBalloon')) held_balloons--; else if (actionState.includes('ScoreBunny')) held_bunnies--; - else if (actionState.includes('EjectBalloon')) held_balloons--; - else if (actionState.includes('EjectBunny')) held_bunnies--; - else if (actionState.includes('EjectTote')) held_totes--; const action: AutoActionData = { action: actionState as AutoAction, @@ -61,7 +64,7 @@ >Intake {#if held_scorables > 0} - {/if} @@ -72,7 +75,7 @@ {/if} {:else if is_intake_state} -