From ddfdc8947afcc87010d04594debfda1690398ac5 Mon Sep 17 00:00:00 2001 From: Sage Vaillancourt Date: Mon, 24 Feb 2025 22:37:15 -0500 Subject: [PATCH] Bail early on pitch() if one was not actually requested --- src/main.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main.lua b/src/main.lua index b579273..685e945 100644 --- a/src/main.lua +++ b/src/main.lua @@ -225,6 +225,9 @@ end ---@param pitchTypeIndex number | nil ---@param accuracy number The closer to 1.0, the better function Game:pitch(pitchFlyTimeMs, pitchTypeIndex, accuracy) + if pitchTypeIndex == nil then + return -- No throw! + end self.state.ball:markUncatchable() self.state.ball.heldBy = nil self.state.pitchIsOver = false