Skip to content

Commit

Permalink
set player's shown formspec to nil on leaving or death
Browse files Browse the repository at this point in the history
prevents beacon digging being blocked when a player was looking at the beacon's formspec when they left or died
  • Loading branch information
OgelGames committed Feb 25, 2020
1 parent b019106 commit bd70b2e
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions formspec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -146,3 +146,11 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
return true
end
end)

minetest.register_on_leaveplayer(function(player)
shown_formspecs[player:get_player_name()] = nil
end)

minetest.register_on_dieplayer(function(player)
shown_formspecs[player:get_player_name()] = nil
end)

0 comments on commit bd70b2e

Please sign in to comment.