tidy code, add wasp nil check, fix whale egg texture (thanks mckaygerhard)
This commit is contained in:
parent
8d6f9661bf
commit
427b453a38
4
api.lua
4
api.lua
@ -60,7 +60,6 @@ function object_attach(entity, player, attach_at, eye_offset)
|
||||
minetest.after(0.2, function()
|
||||
default.player_set_animation(player, "sit" , 30)
|
||||
end)
|
||||
--entity.object:set_yaw(player:get_look_yaw() - math.pi / 2)
|
||||
entity.object:set_yaw(player:get_look_horizontal() - math.pi / 2)
|
||||
end
|
||||
|
||||
@ -106,7 +105,6 @@ function object_drive(entity, dtime, speed, shoots, arrow, moving_anim, stand_an
|
||||
local vec_forward = {x=dir.x*speed,y=-2,z=dir.z*speed}
|
||||
local vec_backward = {x=-dir.x*speed,y=-2,z=-dir.z*speed}
|
||||
local vec_stop = {x=0,y=0,z=0}
|
||||
--local yaw = entity.driver:get_look_yaw()
|
||||
local yaw = entity.driver:get_look_horizontal()
|
||||
if ctrl.up then
|
||||
entity.object:set_yaw(yaw+math.pi+math.pi/2)
|
||||
@ -188,7 +186,6 @@ function object_fly(entity, dtime, speed, shoots, arrow, moving_anim, stand_anim
|
||||
local pos = entity.object:get_pos()
|
||||
local obj = minetest.add_entity({x=pos.x+0+dir.x*2.5,y=pos.y+1.5+dir.y,z=pos.z+0+dir.z*2.5}, arrow)
|
||||
local vec = vector.multiply(dir, 12)
|
||||
--local yaw = entity.driver:get_look_yaw()
|
||||
local yaw = entity.driver:get_look_horizontal()
|
||||
entity.loaded = true
|
||||
obj:set_yaw(yaw+math.pi/2)
|
||||
@ -254,7 +251,6 @@ function lib_mount.attach(entity, player, attach_at, eye_offset)
|
||||
minetest.after(0.2, function()
|
||||
default.player_set_animation(player, "sit" , 30)
|
||||
end)
|
||||
-- --entity.object:set_yaw(player:get_look_yaw() - math.pi / 2)
|
||||
-- entity.object:set_yaw(player:get_look_horizontal() - math.pi / 2)
|
||||
end
|
||||
|
||||
|
@ -106,7 +106,7 @@ mobs:register_mob("dmobs:wasp_leader", {
|
||||
|
||||
if math.random(1, 500) >= 500 then
|
||||
|
||||
local pos = self.object:get_pos()
|
||||
local pos = self.object:get_pos() ; if not pos then return end
|
||||
|
||||
minetest.add_entity(pos, "dmobs:wasp")
|
||||
end
|
||||
|
@ -60,4 +60,4 @@ mobs:register_mob("dmobs:whale", {
|
||||
})
|
||||
|
||||
|
||||
mobs:register_egg("dmobs:whale", "Whale", "default_water_source.png", 1)
|
||||
mobs:register_egg("dmobs:whale", "Whale", "default_water.png", 1)
|
||||
|
Loading…
x
Reference in New Issue
Block a user