vehicle drives the way it is facing

master
D00Med 2017-02-05 11:09:33 +10:00
parent 48cfd702f8
commit cb4310db63
2 changed files with 3 additions and 1 deletions

View File

@ -229,6 +229,8 @@ function vehicles.object_drive(entity, dtime, def)
else
entity.object:setyaw(target_yaw)
end
dir.x = -math.sin(entity_yaw)
dir.z = math.cos(entity_yaw)
else
--minetest.chat_send_all("yaw:"..entity_yaw)
--minetest.chat_send_all("dirx: "..dir.x.." dirz:"..dir.z)

View File

@ -1478,7 +1478,7 @@ minetest.register_entity("vehicles:apache", {
hp_max = 200,
animation_speed = 5,
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)
if self.driver and clicker == self.driver then
vehicles.object_detach(self, clicker, {x=1, y=0, z=1})