@@ 99,7 99,10 @@ end
-- FIXME This is O(signs*players). We should store active signs by player, so we don't have
-- to iterate over all of them.
minetest.register_on_joinplayer(update_all_active_signs)
-minetest.register_on_leaveplayer(update_all_active_signs)
+-- NOTE: the on_leaveplayer callback gets called before the player actually gets
+-- removed from the online players list, so we use after() to delay the update
+-- after the leave is complete.
+minetest.register_on_leaveplayer(function() minetest.after(0, update_all_active_signs) end)
-- Standard signs
-----------------