Switch coordinate conversion in commands.lua
This commit is contained in:
parent
8aed769b97
commit
490104f646
@ -1,4 +1,4 @@
|
|||||||
local map_formspec = ...;
|
local chunk, map_formspec = ...;
|
||||||
|
|
||||||
local MAXINT = 2147483647;
|
local MAXINT = 2147483647;
|
||||||
|
|
||||||
@ -12,7 +12,8 @@ minetest.register_chatcommand("map", {
|
|||||||
local player = minetest.get_player_by_name(name);
|
local player = minetest.get_player_by_name(name);
|
||||||
local pos = player:get_pos();
|
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*)");
|
local detail, scale = param:match("(%d*) (%d*)");
|
||||||
|
|
||||||
|
2
init.lua
2
init.lua
@ -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);
|
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);
|
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 .. "/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);
|
loadfile(modpath .. "/table.lua") (gui, skin);
|
||||||
|
|
||||||
cartographer.skin = skin;
|
cartographer.skin = skin;
|
||||||
|
Loading…
Reference in New Issue
Block a user