diff options
author | Hume2 <teratux.mail@gmail.com> | 2018-09-09 18:21:10 +0200 |
---|---|---|
committer | Hume2 <teratux.mail@gmail.com> | 2018-09-09 18:21:10 +0200 |
commit | af11c3e7585c1cc89686a84c1e133f018d1980af (patch) | |
tree | 90ef7f15efc2c34ed7d12c4f4a863478f1e8308a | |
parent | f026ea2894a1e0d24c2378d75a73263153db2311 (diff) |
Dismount all players on server shutdown
-rw-r--r-- | init.lua | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -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) |