Browse Source

Fix bounds-checking on marker pages

tags/1.0
Hugues Ross 1 month ago
parent
commit
f528ac78bd
2 changed files with 3 additions and 3 deletions
  1. +2
    -2
      items.lua
  2. +1
    -1
      scanner.lua

+ 2
- 2
items.lua View File

@@ -279,9 +279,9 @@ minetest.register_on_player_receive_fields(function(player, name, fields)
audio.play_feedback("cartographer_write", player);
show_map_formspec(map, pos.x, pos.z, player:get_player_name(), data.page);
elseif k == "prev_button" then
show_map_formspec(map, pos.x, pos.z, player:get_player_name(), data.height_mode, data.page - 1);
show_map_formspec(map, pos.x, pos.z, player:get_player_name(), data.height_mode, math.max(data.page - 1, 1));
elseif k == "next_button" then
show_map_formspec(map, pos.x, pos.z, player:get_player_name(), data.height_mode, data.page + 1);
show_map_formspec(map, pos.x, pos.z, player:get_player_name(), data.height_mode, math.min(data.page + 1, math.ceil(markers.count() / 20)));
elseif k == "height_button" then
show_map_formspec(map, pos.x, pos.z, player:get_player_name(), not data.height_mode, data.page);
elseif k == "quit" then


+ 1
- 1
scanner.lua View File

@@ -226,7 +226,7 @@ local function scan_internal()
end

local biome,height = get_biome(startpos, endpos);
if biome ~= nil then
if biome ~= nil then
register_tile(chunk_x, chunk_z, biome, height, true)
end



Loading…
Cancel
Save