mirror of
https://git.minetest.land/VoxeLibre/VoxeLibre.git
synced 2024-11-17 16:41:06 +01:00
Merge pull request 'fix punching ghast not getting velocity' (#2811) from fix_crash_when_punching_ghast into master
Reviewed-on: https://git.minetest.land/MineClone2/MineClone2/pulls/2811 Reviewed-by: PrairieWind <prairie.astronomer1@gmail.com>
This commit is contained in:
commit
6b146bd6fb
1 changed files with 1 additions and 0 deletions
|
@ -3459,6 +3459,7 @@ local mob_punch = function(self, hitter, tflp, tool_capabilities, dir)
|
||||||
dir = dir or {x = 0, y = 0, z = 0}
|
dir = dir or {x = 0, y = 0, z = 0}
|
||||||
|
|
||||||
local v = self.object:get_velocity()
|
local v = self.object:get_velocity()
|
||||||
|
if not v then return end
|
||||||
local r = 1.4 - min(punch_interval, 1.4)
|
local r = 1.4 - min(punch_interval, 1.4)
|
||||||
local kb = r * (abs(v.x)+abs(v.z))
|
local kb = r * (abs(v.x)+abs(v.z))
|
||||||
local up = 2
|
local up = 2
|
||||||
|
|
Loading…
Reference in a new issue