mirror of
https://github.com/SmallJoker/boost_cart.git
synced 2025-01-09 03:17:27 +01:00
Fix nil error on tool_capabilities
This commit is contained in:
parent
afb52ba3b4
commit
145ca1c61d
8
init.lua
8
init.lua
@ -116,8 +116,12 @@ function boost_cart.cart:on_punch(puncher, time_from_last_punch, tool_capabiliti
|
||||
return
|
||||
end
|
||||
|
||||
time_from_last_punch = math.min(time_from_last_punch, tool_capabilities.full_punch_interval)
|
||||
local f = 3 * (time_from_last_punch / tool_capabilities.full_punch_interval)
|
||||
local punch_interval = 1
|
||||
if tool_capabilities and tool_capabilities.full_punch_interval then
|
||||
punch_interval = tool_capabilities.full_punch_interval
|
||||
end
|
||||
time_from_last_punch = math.min(time_from_last_punch or punch_interval, punch_interval)
|
||||
local f = 3 * (time_from_last_punch / punch_interval)
|
||||
|
||||
self.velocity = vector.multiply(cart_dir, f)
|
||||
self.old_pos = nil
|
||||
|
Loading…
Reference in New Issue
Block a user