crash correction
parent
199a7f9a76
commit
3b78b070ed
|
@ -37,6 +37,9 @@ function helicopter.check_node_below(obj)
|
|||
end
|
||||
|
||||
function helicopter.heli_control(self, dtime, touching_ground, liquid_below, vel_before)
|
||||
if self.driver_name == nil then
|
||||
return
|
||||
end
|
||||
local driver = minetest.get_player_by_name(self.driver_name)
|
||||
if not driver then
|
||||
-- there is no driver (eg. because driver left)
|
||||
|
|
6
init.lua
6
init.lua
|
@ -435,8 +435,10 @@ minetest.register_entity("helicopter:heli", {
|
|||
-- driver clicked the object => driver gets off the vehicle
|
||||
self.driver_name = nil
|
||||
-- sound and animation
|
||||
minetest.sound_stop(self.sound_handle)
|
||||
self.sound_handle = nil
|
||||
if self.sound_handle then
|
||||
minetest.sound_stop(self.sound_handle)
|
||||
self.sound_handle = nil
|
||||
end
|
||||
self.object:set_animation_frame_speed(0)
|
||||
-- detach the player
|
||||
clicker:set_detach()
|
||||
|
|
Loading…
Reference in New Issue