fix mortick nil check, use new get_look_horizontal functions

master
tenplus1 2022-01-14 09:00:08 +00:00
parent 633fc46e31
commit 7671b5215d
2 changed files with 9 additions and 2 deletions

View File

@ -165,7 +165,14 @@ minetest.register_entity("nssm:mortick", {
if self.attack ~= 0 then
local p = self.attack:get_pos()
local yawp = self.attack:get_look_yaw()
-- Just incase player teleports away or leaves game
if not p then
self.attack = nil
return
end
local yawp = self.attack:get_look_horizontal() + math.pi / 2
local pi = math.pi
p.y = p.y + 1

View File

@ -208,7 +208,7 @@ mobs:register_mob("nssm:morlu", {
self.morlu_timer = os.time()
self.curr_attack = self.attack
self.state = ""
local pyaw = self.curr_attack: get_look_yaw()
local pyaw = self.curr_attack: get_look_horizontal() + math.pi / 2
self.dir = pyaw
self.object:set_yaw(pyaw)
if self then