mirror of
https://github.com/joe7575/tubelib2.git
synced 2024-12-01 03:43:45 +01:00
Update cache when pairing is stopped
This commit is contained in:
parent
3530843eee
commit
364dbdfc18
@ -414,8 +414,12 @@ function Tube:stop_pairing(pos, oldmetadata, sFormspec)
|
||||
if oldmetadata.fields.tele_pos then
|
||||
local tele_pos = minetest.string_to_pos(oldmetadata.fields.tele_pos)
|
||||
local peer_meta = M(tele_pos)
|
||||
local tube_dir = tonumber(oldmetadata.fields.tube_dir or 0)
|
||||
self:del_from_cache(get_pos(pos, tube_dir), Turn180Deg[tube_dir])
|
||||
if peer_meta then
|
||||
self:after_place_node(tele_pos, {peer_meta:get_int("tube_dir")})
|
||||
local peer_dir = tonumber(peer_meta:get_int("tube_dir") or 0)
|
||||
self:del_from_cache(get_pos(tele_pos, peer_dir), Turn180Deg[peer_dir])
|
||||
self:after_place_node(tele_pos, {peer_dir})
|
||||
peer_meta:set_string("channel", nil)
|
||||
peer_meta:set_string("tele_pos", nil)
|
||||
peer_meta:set_string("formspec", sFormspec)
|
||||
|
Loading…
Reference in New Issue
Block a user