More unused var cleanup

This commit is contained in:
Hugues Ross 2020-06-01 18:22:08 -04:00
parent a761c9323f
commit dc8cc1e10b
3 changed files with 8 additions and 21 deletions

View File

@ -4,7 +4,7 @@ read_globals = {
"dump", "dump2",
"vector",
"VoxelManip", "VoxelArea",
"PseudoRandom", "PcgRandom",
"PseudoRandom", "PcgRandom", "PerlinNoiseMap",
"ItemStack",
"Settings",
"unpack",

View File

@ -36,7 +36,7 @@ local map_formspec_prefix = [[
]];
local tile = "image[%f,%f;%f,%f;%s]";
local marker = "animated_image[%f,%f;%f,%f;;%s;%d;%d]";
local player_marker = "animated_image[%f,%f;%f,%f;;%s;%d;%d]";
-- Generate formspec markup for an unknown biome tile
-- x: The x position of the tile
@ -113,11 +113,11 @@ local function generate_map(x, y, w, h, player_x, player_y, detail, map_scale, h
if i == player_x and j == player_y then
local player_icon = cartographer.detail_texture(cartographer.skin.player_icons, detail);
str = str..marker:format(fx, fy - height,
TILE_SIZE, TILE_SIZE,
player_icon.texture .. ".png",
player_icon.frame_count,
player_icon.frame_duration);
str = str .. player_marker:format(fx, fy - height,
TILE_SIZE, TILE_SIZE,
player_icon.texture .. ".png",
player_icon.frame_count,
player_icon.frame_duration);
end
else
str = str .. unknown_biome_tile(fx, fy, detail, get_variant(i - x, j - y, noise));

View File

@ -43,15 +43,11 @@ local function get_mapgen_biome(min, max, mmin, mmax)
local heights = minetest.get_mapgen_object("heightmap");
local xx = max.x - min.x;
local yy = max.y - min.y;
local zz = max.z - min.z;
local xxx = mmax.x - mmin.x;
local yyy = mmax.y - mmin.y;
local zzz = mmax.z - mmin.z;
local startx = min.x - mmin.x;
local starty = min.y - mmin.y;
local startz = min.z - mmin.z;
local scan_biomes = {};
@ -89,10 +85,6 @@ local function get_biome(min, max)
local DEFAULT = minetest.get_biome_id("default");
local WATER_SOURCE = minetest.registered_aliases["mapgen_water_source"];
local xx = max.x - min.x;
local yy = max.y - min.y;
local zz = max.z - min.z;
local scan_biomes = {};
local scan_heights = {};
@ -131,12 +123,7 @@ local function get_biome(min, max)
return biome, avg_height;
end
local function on_generated(min, max, blockseed)
local chunk = {
x = tochunk(min.x),
y = tochunk(min.z),
};
local function on_generated(min, max, _)
for i = tochunk(min.x),tochunk(max.x),1 do
for j = tochunk(min.z),tochunk(max.z),1 do