Bail early on pitch() if one was not actually requested

This commit is contained in:
Sage Vaillancourt 2025-02-24 22:37:15 -05:00
parent e035c0ca72
commit ddfdc8947a
1 changed files with 3 additions and 0 deletions

View File

@ -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