Add modlib.minetest.register_on_leaveplayer

This commit is contained in:
Lars Mueller 2021-08-23 18:44:07 +02:00
parent 5ae7cc254f
commit a792aa2e31
2 changed files with 6 additions and 1 deletions

@ -25,7 +25,8 @@ for filename, comps in pairs{
"objects_inside_area", "objects_inside_area",
"nodename_matcher", "nodename_matcher",
"playerdata", "playerdata",
"connected_players" "connected_players",
"register_on_leaveplayer"
}, },
liquid = { liquid = {
"liquid_level_max", "liquid_level_max",

@ -248,3 +248,7 @@ function connected_players()
return connected_players[index] return connected_players[index]
end end
end end
function register_on_leaveplayer(func)
return minetest["register_on_" .. (minetest.is_singleplayer() and "shutdown" or "leaveplayer")](func)
end