Fix player position on scaled maps

This commit is contained in:
Hugues Ross 2020-04-20 19:27:43 -04:00
parent b4acab145e
commit fcb6de872c

View File

@ -66,8 +66,6 @@ end
local function generate_map(data, x, y, w, h, player_x, player_y, detail, map_scale, is_visible, get_marker, user) local function generate_map(data, x, y, w, h, player_x, player_y, detail, map_scale, is_visible, get_marker, user)
local str = ""; local str = "";
local noise = PerlinNoiseMap(MAP_NOISE, { x=w + 1, y=h + 1, z=1}):get_2d_map({ x=x, y=y}); local noise = PerlinNoiseMap(MAP_NOISE, { x=w + 1, y=h + 1, z=1}):get_2d_map({ x=x, y=y});
player_x = math.floor(player_x / map_scale + 0.5);
player_y = math.floor(player_y / map_scale + 0.5);
for i = x,x + w,1 do for i = x,x + w,1 do
local fx = (i - x) * TILE_OFFSET; local fx = (i - x) * TILE_OFFSET;