forked from minetest/minetest_game
Fix nil deref issue with people hitting chests too often.
This commit is contained in:
parent
a533434b58
commit
55f81d0802
@ -1801,11 +1801,15 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
|
||||
if formname ~= "default:chest" then
|
||||
return
|
||||
end
|
||||
if not fields.quit then
|
||||
if not player or not fields.quit then
|
||||
return
|
||||
end
|
||||
local pn = player:get_player_name()
|
||||
|
||||
if not open_chests[pn] then
|
||||
return
|
||||
end
|
||||
|
||||
local pos = open_chests[pn].pos
|
||||
local sound = open_chests[pn].sound
|
||||
local swap = open_chests[pn].swap
|
||||
|
Loading…
Reference in New Issue
Block a user