diff options
author | TenPlus1 <kinsellaja@yahoo.com> | 2017-01-19 15:01:58 +0000 |
---|---|---|
committer | TenPlus1 <kinsellaja@yahoo.com> | 2017-01-19 15:01:58 +0000 |
commit | 26d80126f556997954b41245f50f9ba1606aeb57 (patch) | |
tree | f6d3d59c98d591b5932d5c9b14b2e76210fb4092 /mount.lua | |
parent | a33a52d140aaaf92d32f345a2c9f6f4cbbcede3d (diff) |
added driver_scale to ridable mobs
Diffstat (limited to 'mount.lua')
-rw-r--r-- | mount.lua | 24 |
1 files changed, 12 insertions, 12 deletions
@@ -80,6 +80,7 @@ local function force_detach(player) default.player_attached[player:get_player_name()] = false player:set_eye_offset({x = 0, y = 0, z = 0}, {x = 0, y = 0, z = 0}) default.player_set_animation(player, "stand" , 30) + player:set_properties({visual_size = {x = 1, y = 1} }) end @@ -108,9 +109,10 @@ function mobs.attach(entity, player) local attach_at, eye_offset = {}, {} - if not entity.player_rotation then - entity.player_rotation = {x = 0, y = 0, z = 0} - end + entity.player_rotation = entity.player_rotation or {x = 0, y = 0, z = 0} + entity.driver_attach_at = entity.driver_attach_at or {x = 0, y = 0, z = 0} + entity.driver_eye_offset = entity.driver_eye_offset or {x = 0, y = 0, z = 0} + entity.driver_scale = entity.driver_scale or {x = 1, y = 1} local rot_view = 0 @@ -118,14 +120,6 @@ function mobs.attach(entity, player) rot_view = math.pi/2 end - if not entity.driver_attach_at then - entity.driver_attach_at = {x = 0, y = 0, z = 0} - end - - if not entity.driver_eye_offset then - entity.driver_eye_offset = {x = 0, y = 0, z = 0} - end - attach_at = entity.driver_attach_at eye_offset = entity.driver_eye_offset entity.driver = player @@ -135,7 +129,13 @@ function mobs.attach(entity, player) player:set_attach(entity.object, "", attach_at, entity.player_rotation) default.player_attached[player:get_player_name()] = true player:set_eye_offset(eye_offset, {x = 0, y = 0, z = 0}) - player:set_properties({visual_size = {x=1, y=1}}) + + player:set_properties({ + visual_size = { + x = entity.driver_scale.x, + y = entity.driver_scale.y + } + }) minetest.after(0.2, function() default.player_set_animation(player, "sit" , 30) |