fix mortick nil check, use new get_look_horizontal functions
This commit is contained in:
parent
633fc46e31
commit
7671b5215d
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user