This commit is contained in:
root 2020-11-17 16:23:21 +01:00
parent 708a098edb
commit 19ebf2bad2
2 changed files with 4 additions and 4 deletions

View file

@ -22,8 +22,7 @@ lib_mount = {
passengers = {}
}
local enable_crash = true
local crash_threshold = 6.5 -- ignored if enable_crash=false
local crash_threshold = 6.5 -- ignored if enable_crash is disabled
------------------------------------------------------------------------------
@ -210,7 +209,7 @@ end
local aux_timer = 0
function lib_mount.drive(entity, dtime, is_mob, moving_anim, stand_anim, jump_height, can_fly, can_go_down, can_go_up)
function lib_mount.drive(entity, dtime, is_mob, moving_anim, stand_anim, jump_height, can_fly, can_go_down, can_go_up, enable_crash)
aux_timer = aux_timer + dtime
if can_fly and can_fly == true then

View file

@ -26,6 +26,7 @@ function vehicle_mash.register_vehicle(name, def)
passenger3_eye_offset = def.passenger3_eye_offset,
passenger3_detach_pos_offset = def.passenger3_detach_pos_offset,
enable_crash = def.enable_crash or true,
visual = def.visual,
mesh = def.mesh,
textures = def.textures,
@ -139,7 +140,7 @@ function vehicle_mash.register_vehicle(name, def)
end
end,
on_step = function(self, dtime)
drive(self, dtime, false, nil, nil, 0, def.can_fly, def.can_go_down, def.can_go_up)
drive(self, dtime, false, nil, nil, 0, def.can_fly, def.can_go_down, def.can_go_up, def.enable_crash)
end
})