mirror of
https://codeberg.org/tenplus1/mobs_redo.git
synced 2024-12-24 09:40:21 +01:00
add sanity check to do_punch
This commit is contained in:
parent
dde9896a1a
commit
9b0ff17101
4
api.lua
4
api.lua
@ -2783,6 +2783,10 @@ function mob_class:on_punch(hitter, tflp, tool_capabilities, dir)
|
|||||||
and tflp >= punch_interval then
|
and tflp >= punch_interval then
|
||||||
|
|
||||||
local v = self.object:get_velocity()
|
local v = self.object:get_velocity()
|
||||||
|
|
||||||
|
-- sanity check
|
||||||
|
if not v then return end
|
||||||
|
|
||||||
local kb = damage or 1
|
local kb = damage or 1
|
||||||
local up = 2
|
local up = 2
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user