From 490104f64687ad76ec2064a9defdbaf2efebd085 Mon Sep 17 00:00:00 2001 From: Hugues Ross Date: Mon, 8 Jun 2020 20:28:36 -0400 Subject: [PATCH] Switch coordinate conversion in commands.lua --- commands.lua | 5 +++-- init.lua | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/commands.lua b/commands.lua index 0cb90b9..804703b 100644 --- a/commands.lua +++ b/commands.lua @@ -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*)"); diff --git a/init.lua b/init.lua index e976181..e162a4d 100644 --- a/init.lua +++ b/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); 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;