add sanity check to do_punch

This commit is contained in:
tenplus1 2020-04-11 17:51:15 +01:00
parent dde9896a1a
commit 9b0ff17101
1 changed files with 4 additions and 0 deletions

View File

@ -2783,6 +2783,10 @@ function mob_class:on_punch(hitter, tflp, tool_capabilities, dir)
and tflp >= punch_interval then
local v = self.object:get_velocity()
-- sanity check
if not v then return end
local kb = damage or 1
local up = 2