vehicle drives the way it is facing
This commit is contained in:
parent
48cfd702f8
commit
cb4310db63
2
api.lua
2
api.lua
@ -229,6 +229,8 @@ function vehicles.object_drive(entity, dtime, def)
|
|||||||
else
|
else
|
||||||
entity.object:setyaw(target_yaw)
|
entity.object:setyaw(target_yaw)
|
||||||
end
|
end
|
||||||
|
dir.x = -math.sin(entity_yaw)
|
||||||
|
dir.z = math.cos(entity_yaw)
|
||||||
else
|
else
|
||||||
--minetest.chat_send_all("yaw:"..entity_yaw)
|
--minetest.chat_send_all("yaw:"..entity_yaw)
|
||||||
--minetest.chat_send_all("dirx: "..dir.x.." dirz:"..dir.z)
|
--minetest.chat_send_all("dirx: "..dir.x.." dirz:"..dir.z)
|
||||||
|
2
init.lua
2
init.lua
@ -1478,7 +1478,7 @@ minetest.register_entity("vehicles:apache", {
|
|||||||
hp_max = 200,
|
hp_max = 200,
|
||||||
animation_speed = 5,
|
animation_speed = 5,
|
||||||
physical = true,
|
physical = true,
|
||||||
collisionbox = {-1.7, 0, -1.7, 1.7, 0.9, 1.7},
|
collisionbox = {-1.8, 0, -1.8, 1.8, 1.5, 1.8},
|
||||||
on_rightclick = function(self, clicker)
|
on_rightclick = function(self, clicker)
|
||||||
if self.driver and clicker == self.driver then
|
if self.driver and clicker == self.driver then
|
||||||
vehicles.object_detach(self, clicker, {x=1, y=0, z=1})
|
vehicles.object_detach(self, clicker, {x=1, y=0, z=1})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user