Browse Source

Fix luacheck warnings

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

+ 4
- 2
items.lua View File

@@ -279,9 +279,11 @@ 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, math.max(data.page - 1, 1));
local new_page = math.max(data.page - 1, 1);
show_map_formspec(map, pos.x, pos.z, player:get_player_name(), data.height_mode, new_page);
elseif k == "next_button" then
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)));
local new_page = math.min(data.page + 1, math.ceil(markers.count() / 20));
show_map_formspec(map, pos.x, pos.z, player:get_player_name(), data.height_mode, new_page);
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


Loading…
Cancel
Save