mirror of
https://git.minetest.land/VoxeLibre/VoxeLibre.git
synced 2024-12-24 00:49:34 +01:00
Fix crash throwing snowball at (runaway=true) mobs
This commit is contained in:
parent
efcd0c8dcc
commit
f61efce434
1 changed files with 2 additions and 2 deletions
|
@ -3518,11 +3518,11 @@ local mob_punch = function(self, hitter, tflp, tool_capabilities, dir)
|
||||||
end -- END if damage
|
end -- END if damage
|
||||||
|
|
||||||
-- if skittish then run away
|
-- if skittish then run away
|
||||||
if not die and self.runaway == true and self.state ~= "flop" then
|
if hitter and is_player and hitter:get_pos() and not die and self.runaway == true and self.state ~= "flop" then
|
||||||
|
|
||||||
yaw = set_yaw(self, minetest.dir_to_yaw(vector.direction(hitter:get_pos(), self.object:get_pos())))
|
yaw = set_yaw(self, minetest.dir_to_yaw(vector.direction(hitter:get_pos(), self.object:get_pos())))
|
||||||
minetest.after(0.2,function()
|
minetest.after(0.2,function()
|
||||||
if self and self.object then
|
if self and self.object and self.object:get_pos() and hitter and is_player and hitter:get_pos() then
|
||||||
yaw = set_yaw(self, minetest.dir_to_yaw(vector.direction(hitter:get_pos(), self.object:get_pos())))
|
yaw = set_yaw(self, minetest.dir_to_yaw(vector.direction(hitter:get_pos(), self.object:get_pos())))
|
||||||
set_velocity(self, self.run_velocity)
|
set_velocity(self, self.run_velocity)
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue