diff --git a/collectible_lore/items.lua b/collectible_lore/items.lua index e4dc6b5..d6c8b16 100644 --- a/collectible_lore/items.lua +++ b/collectible_lore/items.lua @@ -1,7 +1,7 @@ local S = minetest.get_translator(minetest.get_current_modname()) local modmeta = minetest.get_mod_storage() -local cairn_spacing = tonumber(minetest.settings:get("collectible_lore_cairn_spacing")) or 300 +local cairn_spacing = tonumber(minetest.settings:get("collectible_lore_cairn_spacing")) or 100 local torch_node = {name=df_dependencies.node_name_torch, param2=1} collectible_lore.get_light_node = function() return torch_node @@ -174,7 +174,7 @@ minetest.register_node("collectible_lore:cairn", { }) collectible_lore.get_nearby_cairns = function(pos, spacing) - local nearby = cairn_area:get_areas_in_area(vector.subtract(pos, spacing/2), vector.add(pos, spacing/2)) + local nearby = cairn_area:get_areas_in_area(vector.subtract(pos, spacing), vector.add(pos, spacing)) if next(nearby) then return nearby end @@ -279,6 +279,14 @@ minetest.register_on_player_receive_fields(function(player, formname, fields) end end) +function tour(player, loc_list) + local pop = table.remove(loc_list) + if pop then + player:set_pos(pop) + minetest.after(10, tour, player, loc_list) + end +end + minetest.register_chatcommand("cairn_locations", { params = "", -- Short parameter description description = S("Administrative control of collectibles"), @@ -288,8 +296,11 @@ minetest.register_chatcommand("cairn_locations", { local player = minetest.get_player_by_name(name) local player_pos = player:get_pos() local cairn_locations = cairn_area:get_areas_in_area(vector.subtract(player_pos, range), vector.add(player_pos, range)) + --local loc_list = {} for _, data in pairs(cairn_locations) do - minetest.chat_send_player(name, minetest.pos_to_string(data.min)) + minetest.chat_send_player(name, minetest.pos_to_string(data.min)) + --table.insert(loc_list, data.min) end + --tour(player, loc_list) end, }) diff --git a/collectible_lore/settingtypes.txt b/collectible_lore/settingtypes.txt index 7960e5b..072a080 100644 --- a/collectible_lore/settingtypes.txt +++ b/collectible_lore/settingtypes.txt @@ -1 +1 @@ -collectible_lore_cairn_spacing (Minimum distance between collectible cairns) int 300 \ No newline at end of file +collectible_lore_cairn_spacing (Minimum distance between collectible cairns) int 100 \ No newline at end of file diff --git a/df_caverns/shared.lua b/df_caverns/shared.lua index 7cefaad..4f9808b 100644 --- a/df_caverns/shared.lua +++ b/df_caverns/shared.lua @@ -288,6 +288,8 @@ local dfcaverns_mods = { "df_underworld_items:", "ice_sprites:", "mine_gas:", + "bubblesponge:", + "collectible_lore:", -- cairns } df_caverns.is_ground_content = function(c_node)