mirror of
https://github.com/mt-mods/homedecor_modpack.git
synced 2025-01-03 13:30:20 +01:00
cleanup some comments
This commit is contained in:
parent
9c2dc5bca3
commit
348201c4ee
@ -212,15 +212,18 @@ function lrfurn.stand(clicker)
|
|||||||
xcompat.player.player_attached[name] = false
|
xcompat.player.player_attached[name] = false
|
||||||
if seated_cache[name] then
|
if seated_cache[name] then
|
||||||
local attached_to = clicker:get_attach()
|
local attached_to = clicker:get_attach()
|
||||||
if attached_to then --check, a stupid clearobjects might have been called, etc
|
-- Check, clearobjects might have been called, etc
|
||||||
attached_to:remove() --removing also detaches
|
if attached_to then
|
||||||
|
-- Removing also detaches
|
||||||
|
attached_to:remove()
|
||||||
end
|
end
|
||||||
seated_cache[name] = nil
|
seated_cache[name] = nil
|
||||||
offset_cache[name] = nil
|
offset_cache[name] = nil
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function lrfurn.on_seat_destruct(pos) --called when a seat is destroyed
|
-- Called when a seat is destroyed
|
||||||
|
function lrfurn.on_seat_destruct(pos)
|
||||||
for name, seatpos in pairs(seated_cache) do
|
for name, seatpos in pairs(seated_cache) do
|
||||||
if seatpos == minetest.hash_node_position(pos) then
|
if seatpos == minetest.hash_node_position(pos) then
|
||||||
local player = minetest.get_player_by_name(name)
|
local player = minetest.get_player_by_name(name)
|
||||||
@ -242,6 +245,7 @@ function lrfurn.on_seat_movenode(from_pos, to_pos)
|
|||||||
-- Check, clearobjects might have been called, etc
|
-- Check, clearobjects might have been called, etc
|
||||||
if attached_to then
|
if attached_to then
|
||||||
if offset_cache[name] then
|
if offset_cache[name] then
|
||||||
|
-- multi-seat node aka sofas
|
||||||
attached_to:set_pos(vector.subtract(to_pos,
|
attached_to:set_pos(vector.subtract(to_pos,
|
||||||
core.get_position_from_hash(offset_cache[name])))
|
core.get_position_from_hash(offset_cache[name])))
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user