Switch coordinate conversion in commands.lua

This commit is contained in:
Hugues Ross 2020-06-08 20:28:36 -04:00
parent 8aed769b97
commit 490104f646
2 changed files with 4 additions and 3 deletions

View File

@ -1,4 +1,4 @@
local map_formspec = ...;
local chunk, map_formspec = ...;
local MAXINT = 2147483647;
@ -12,7 +12,8 @@ minetest.register_chatcommand("map", {
local player = minetest.get_player_by_name(name);
local pos = player:get_pos();
local player_x, player_z = cartographer.to_map_coordinates(nil, pos.x, pos.z);
local player_x = chunk.to(pos.x);
local player_z = chunk.to(pos.z);
local detail, scale = param:match("(%d*) (%d*)");

View File

@ -54,7 +54,7 @@ local scanner = loadfile(modpath .. "/scanner.lua") (map_data, chunk);
loadfile(modpath .. "/map_api.lua") (map_data, chunk, scanner, biome_lookup, marker_lookup);
local map_formspec = loadfile(modpath .. "/map_formspec.lua") (map_data, gui, skin);
loadfile(modpath .. "/items.lua") (chunk, marker_lookup, gui, skin, map_formspec);
loadfile(modpath .. "/commands.lua") (map_formspec);
loadfile(modpath .. "/commands.lua") (chunk, map_formspec);
loadfile(modpath .. "/table.lua") (gui, skin);
cartographer.skin = skin;