summaryrefslogtreecommitdiff
path: root/init.lua
diff options
context:
space:
mode:
Diffstat (limited to 'init.lua')
-rw-r--r--init.lua9
1 files changed, 9 insertions, 0 deletions
diff --git a/init.lua b/init.lua
index b46c7f7..ef93f4a 100644
--- a/init.lua
+++ b/init.lua
@@ -418,6 +418,15 @@ minetest.register_on_leaveplayer(function(player)
attached[player:get_player_name()] = nil
end)
+-- Dismount all players on server shutdown
+minetest.register_on_shutdown(function()
+ for _, e in pairs(minetest.luaentities) do
+ if (e.driver ~= nil) then
+ dismount_player(e, true)
+ end
+ end
+end)
+
-- Register the entity
minetest.register_entity("bike:bike", bike)