diff --git a/mobs/morde.lua b/mobs/morde.lua index f450f8e..13749b2 100644 --- a/mobs/morde.lua +++ b/mobs/morde.lua @@ -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 diff --git a/mobs/morlu.lua b/mobs/morlu.lua index 5e27ac2..dcf692a 100644 --- a/mobs/morlu.lua +++ b/mobs/morlu.lua @@ -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