mirror of
https://github.com/HybridDog/connected_chests.git
synced 2024-12-28 06:00:17 +01:00
Chest opening: Fix chest not closing itself
This commit is contained in:
parent
476338593b
commit
631d4d83f8
4
init.lua
4
init.lua
@ -516,11 +516,13 @@ connected_chests.register_chest("default:chest", {
|
|||||||
minetest.after(0.2, minetest.show_formspec, pname,
|
minetest.after(0.2, minetest.show_formspec, pname,
|
||||||
"default:chest_connected", spec)
|
"default:chest_connected", spec)
|
||||||
|
|
||||||
|
if not accessed_chests[pname] then
|
||||||
open_chests[vi] = open_chests[vi] or 0
|
open_chests[vi] = open_chests[vi] or 0
|
||||||
open_chests[vi] = open_chests[vi]+1
|
open_chests[vi] = open_chests[vi]+1
|
||||||
|
|
||||||
accessed_chests[pname] = vi
|
accessed_chests[pname] = vi
|
||||||
end
|
end
|
||||||
|
end
|
||||||
})
|
})
|
||||||
|
|
||||||
connected_chests.register_chest("default:chest_locked", {
|
connected_chests.register_chest("default:chest_locked", {
|
||||||
@ -562,11 +564,13 @@ connected_chests.register_chest("default:chest_locked", {
|
|||||||
minetest.after(0.2, minetest.show_formspec, pname,
|
minetest.after(0.2, minetest.show_formspec, pname,
|
||||||
"default:chest_locked_connected", spec)
|
"default:chest_locked_connected", spec)
|
||||||
|
|
||||||
|
if not accessed_chests[pname] then
|
||||||
open_chests[vi] = open_chests[vi] or 0
|
open_chests[vi] = open_chests[vi] or 0
|
||||||
open_chests[vi] = open_chests[vi]+1
|
open_chests[vi] = open_chests[vi]+1
|
||||||
|
|
||||||
accessed_chests[pname] = vi
|
accessed_chests[pname] = vi
|
||||||
end
|
end
|
||||||
|
end
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user