Bail early on pitch() if one was not actually requested
This commit is contained in:
parent
e035c0ca72
commit
ddfdc8947a
|
@ -225,6 +225,9 @@ end
|
||||||
---@param pitchTypeIndex number | nil
|
---@param pitchTypeIndex number | nil
|
||||||
---@param accuracy number The closer to 1.0, the better
|
---@param accuracy number The closer to 1.0, the better
|
||||||
function Game:pitch(pitchFlyTimeMs, pitchTypeIndex, accuracy)
|
function Game:pitch(pitchFlyTimeMs, pitchTypeIndex, accuracy)
|
||||||
|
if pitchTypeIndex == nil then
|
||||||
|
return -- No throw!
|
||||||
|
end
|
||||||
self.state.ball:markUncatchable()
|
self.state.ball:markUncatchable()
|
||||||
self.state.ball.heldBy = nil
|
self.state.ball.heldBy = nil
|
||||||
self.state.pitchIsOver = false
|
self.state.pitchIsOver = false
|
||||||
|
|
Loading…
Reference in New Issue