fix weird spin for certain target yaw values
This commit is contained in:
parent
ba3700098f
commit
e41763700d
5
api.lua
5
api.lua
@ -223,7 +223,12 @@ function vehicles.object_drive(entity, dtime, def)
|
||||
local target_yaw = yaw+math.pi+math.pi/2+extra_yaw
|
||||
local entity_yaw = entity.object:getyaw()
|
||||
if entity_yaw ~= target_yaw then
|
||||
minetest.chat_send_all(target_yaw)
|
||||
if target_yaw <= 6.2 and target_yaw >= 0.2 then
|
||||
entity.object:setyaw(entity_yaw+(target_yaw-entity_yaw)/3)
|
||||
else
|
||||
entity.object:setyaw(target_yaw)
|
||||
end
|
||||
end
|
||||
|
||||
--lava explode
|
||||
|
34
init.lua
34
init.lua
@ -2057,6 +2057,40 @@ minetest.register_craft({
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "vehicles:helicopter_spawner",
|
||||
recipe = {
|
||||
{"", "vehicles:propeller", ""},
|
||||
{"vehicles:propeller", "vehicles:engine", "default:glass"},
|
||||
{"", "default:steel_ingot", ""}
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "vehicles:apache_spawner",
|
||||
recipe = {
|
||||
{"", "vehicles:propeller", ""},
|
||||
{"vehicles:propeller", "vehicles:engine", "default:glass"},
|
||||
{"", "vehicles:armor", "default:steel_ingot"}
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "vehicles:lightcycle_spawner",
|
||||
recipe = {
|
||||
{"default:steel_ingot", "vehicles:engine", "dye:cyan"},
|
||||
{"vehicles:wheel", "default:steel_ingot", "vehicles:wheel"}
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "vehicles:lightcycle2_spawner",
|
||||
recipe = {
|
||||
{"default:steel_ingot", "vehicles:engine", "dye:orange"},
|
||||
{"vehicles:wheel", "default:steel_ingot", "vehicles:wheel"}
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "vehicles:boat_spawner",
|
||||
recipe = {
|
||||
|
Loading…
x
Reference in New Issue
Block a user