Tuck bat away if `batter` is `nil`
This commit is contained in:
parent
3a465cb02d
commit
b928ee3658
|
@ -392,8 +392,8 @@ function Game:updateBatting(batDeg, batSpeed)
|
|||
local batAngle = math.rad(batDeg)
|
||||
-- TODO: animate bat-flip or something
|
||||
local batter = self.baserunning.batter
|
||||
self.state.batBase.x = batter and (batter.x + C.BatterHandPos.x) or 0
|
||||
self.state.batBase.y = batter and (batter.y + C.BatterHandPos.y) or 0
|
||||
self.state.batBase.x = batter and (batter.x + C.BatterHandPos.x) or -999
|
||||
self.state.batBase.y = batter and (batter.y + C.BatterHandPos.y) or -999
|
||||
self.state.batTip.x = self.state.batBase.x + (C.BatLength * math.sin(batAngle))
|
||||
self.state.batTip.y = self.state.batBase.y + (C.BatLength * math.cos(batAngle))
|
||||
|
||||
|
|
Loading…
Reference in New Issue