summaryrefslogtreecommitdiff
path: root/mount.lua
diff options
context:
space:
mode:
authorTenPlus1 <kinsellaja@yahoo.com>2017-03-02 20:41:45 +0000
committerTenPlus1 <kinsellaja@yahoo.com>2017-03-02 20:41:45 +0000
commit18d42f2285512b62bf81ca180538e0511bad448b (patch)
tree296afb4fb45eef1792f9cab5db02d4f1617f8c62 /mount.lua
parent8d8779da2f0d361f45878ea4404a58db04e00b85 (diff)
limit mob names to 64 chars, update mount lib to new 0.4.15 functions
Diffstat (limited to 'mount.lua')
-rw-r--r--mount.lua14
1 files changed, 8 insertions, 6 deletions
diff --git a/mount.lua b/mount.lua
index 0b08613..84874ef 100644
--- a/mount.lua
+++ b/mount.lua
@@ -141,7 +141,8 @@ function mobs.attach(entity, player)
default.player_set_animation(player, "sit" , 30)
end)
- player:set_look_yaw(entity.object:getyaw() - rot_view)
+ --player:set_look_yaw(entity.object:getyaw() - rot_view)
+ player:set_look_horizontal(entity.object:getyaw() - rot_view)
end
@@ -196,10 +197,8 @@ function mobs.drive(entity, moving_anim, stand_anim, can_fly, dtime)
entity.v = entity.v - entity.accel / 10
end
- --entity.object:setyaw(entity.driver:get_look_yaw() - rot_steer)
--- entity.object:setyaw(entity.driver:get_look_horizontal())-- - rot_steer)
-
-- fix mob rotation
+-- entity.object:setyaw(entity.driver:get_look_yaw() - entity.rotate)
entity.object:setyaw(entity.driver:get_look_horizontal() - entity.rotate)
if can_fly then
@@ -376,7 +375,8 @@ function mobs.fly(entity, dtime, speed, shoots, arrow, moving_anim, stand_anim)
local ctrl = entity.driver:get_player_control()
local velo = entity.object:getvelocity()
local dir = entity.driver:get_look_dir()
- local yaw = entity.driver:get_look_yaw()
+-- local yaw = entity.driver:get_look_yaw()
+ local yaw = entity.driver:get_look_horizontal() + 1.57 -- offset fix between old and new commands
local rot_steer, rot_view = math.pi / 2, 0
if entity.player_rotation.y == 90 then
@@ -415,8 +415,10 @@ function mobs.fly(entity, dtime, speed, shoots, arrow, moving_anim, stand_anim)
local ent = obj:get_luaentity()
if ent then
ent.switch = 1 -- for mob specific arrows
+ ent.owner_id = tostring(entity.object) -- so arrows dont hurt entity you are riding
local vec = {x = dir.x * 6, y = dir.y * 6, z = dir.z * 6}
- local yaw = entity.driver:get_look_yaw()
+-- local yaw = entity.driver:get_look_yaw()
+ local yaw = entity.driver:get_look_horizontal()
obj:setyaw(yaw + math.pi / 2)
obj:setvelocity(vec)
else