Skip to content

Commit

Permalink
async race condition fix
Browse files Browse the repository at this point in the history
  • Loading branch information
SwissalpS authored May 2, 2024
1 parent fe4d5bf commit 7f63b3f
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions compat-chests.lua
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,19 @@ if minetest.get_modpath("default") then
if formname ~= "default:chest" then
return
end
if fields.quit then
return
end
local pn = player:get_player_name()
if not pn then
local chest_open = default.chest.open_chests[pn]
if not chest_open then
-- chest already closed before formspec
return
end
local pos = default.chest.open_chests[pn].pos
local pos = chest_open.pos
local chest = pos and minetest.get_node(pos)
local is_pipeworks_chest = chest and pipeworks.chests[chest]
if is_pipeworks_chest and not fields.quit and pipeworks.may_configure(pos, player) then
if is_pipeworks_chest and pipeworks.may_configure(pos, player) then
-- Pipeworks Switch
fs_helpers.on_receive_fields(pos, fields)
minetest.show_formspec(pn,
Expand Down

0 comments on commit 7f63b3f

Please sign in to comment.