mirror of
https://git.minetest.land/VoxeLibre/VoxeLibre.git
synced 2024-11-30 22:41:20 +01:00
Cleanup debug prints
This commit is contained in:
parent
35bc1b6be4
commit
0ad7ddf2c6
2 changed files with 1 additions and 7 deletions
|
@ -616,36 +616,30 @@ minetest.register_on_joinplayer(function(player)
|
||||||
local meta = mcl_playerinfo.get_mod_meta(player_name, modname)
|
local meta = mcl_playerinfo.get_mod_meta(player_name, modname)
|
||||||
local cart_uuid = meta.attached_to
|
local cart_uuid = meta.attached_to
|
||||||
if cart_uuid then
|
if cart_uuid then
|
||||||
print("Trying to reattach "..player_name.." to cart #"..cart_uuid)
|
|
||||||
local cartdata = get_cart_data(cart_uuid)
|
local cartdata = get_cart_data(cart_uuid)
|
||||||
|
|
||||||
-- Can't get into a cart that was destroyed
|
-- Can't get into a cart that was destroyed
|
||||||
if not cartdata then
|
if not cartdata then
|
||||||
print("Failed to get cartdata")
|
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Don't reattach players if someone else got in the cart
|
-- Don't reattach players if someone else got in the cart
|
||||||
if cartdata.last_player ~= player_name then
|
if cartdata.last_player ~= player_name then
|
||||||
print("Somebody else got in the cart while you were gone")
|
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
minetest.after(0.2,function(player_name, cart_uuid)
|
minetest.after(0.2,function(player_name, cart_uuid)
|
||||||
local player = minetest.get_player_by_name(player_name)
|
local player = minetest.get_player_by_name(player_name)
|
||||||
if not player then
|
if not player then
|
||||||
print("Can't get an ObjectRef for "..player_name)
|
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
local cart = mcl_util.get_luaentity_from_uuid(cart_uuid)
|
local cart = mcl_util.get_luaentity_from_uuid(cart_uuid)
|
||||||
if not cart then
|
if not cart then
|
||||||
print("Can't find the luaentity for cart #"..cart_uuid)
|
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
mod.attach_driver(cart, player)
|
mod.attach_driver(cart, player)
|
||||||
|
|
||||||
end, player_name, cart_uuid)
|
end, player_name, cart_uuid)
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
|
@ -33,7 +33,7 @@ mod.detach_minecart = detach_minecart
|
||||||
local function try_detach_minecart(staticdata)
|
local function try_detach_minecart(staticdata)
|
||||||
if not staticdata or not staticdata.connected_at then return end
|
if not staticdata or not staticdata.connected_at then return end
|
||||||
if not mod:is_rail(staticdata.connected_at) then
|
if not mod:is_rail(staticdata.connected_at) then
|
||||||
print("Detaching minecart #"..tostring(staticdata.uuid))
|
mcl_debug("Detaching minecart #"..tostring(staticdata.uuid))
|
||||||
detach_minecart(staticdata)
|
detach_minecart(staticdata)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue