Skip to content

Commit

Permalink
fix chest duplication bug (#119)
Browse files Browse the repository at this point in the history
closes #118

Co-authored-by: BuckarooBanzay <[email protected]>
  • Loading branch information
BuckarooBanzay and BuckarooBanzay authored Mar 17, 2024
1 parent 1577af7 commit 1b79084
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions compat-chests.lua
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,12 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
end
minetest.after(0.2, function()
if minetest.get_modpath("default") then
local current_node = minetest.get_node(pos)
if current_node.name ~= "default:" .. swap .. "_open" then
-- the chest has already been replaced, don't try to replace what's there.
-- see: https://github.com/minetest/minetest_game/pull/3046
return
end
minetest.swap_node(pos, { name = "default:" .. swap, param2 = node.param2 })
end

Expand Down

0 comments on commit 1b79084

Please sign in to comment.