forked from nalc/nalc_game
		
	Fix nil deref issue with people hitting chests too often.
This commit is contained in:
		| @@ -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 | ||||
|   | ||||
		Reference in New Issue
	
	Block a user