From 331eb28d3b1463d674d4d212e2b4bba172cd089f Mon Sep 17 00:00:00 2001 From: Sokomine Date: Mon, 3 Apr 2017 21:44:22 +0200 Subject: [PATCH] really provide the build_chest position to the dig-here-indicators --- build_chest.lua | 4 ++-- place_buildings.lua | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/build_chest.lua b/build_chest.lua index b296722..cdd1a5a 100644 --- a/build_chest.lua +++ b/build_chest.lua @@ -702,7 +702,7 @@ mirror = nil; if( not( minetest.check_player_privs( pname, {creative=true}))) then use_scaffolding = true; end - fields.error_msg = handle_schematics.place_building_from_file( start_pos, end_pos, building_name, replacement_list, rotate, axis, mirror, no_plotmarker, false, use_scaffolding ); + fields.error_msg = handle_schematics.place_building_from_file( start_pos, end_pos, building_name, replacement_list, rotate, axis, mirror, no_plotmarker, false, use_scaffolding, pos ); if( fields.error_msg ) then fields.error_msg = 'Error: '..tostring( fields.error_msg ); end @@ -732,7 +732,7 @@ mirror = nil; local axis = build_chest.building[ building_name ].axis; local no_plotmarker = true; local replacement_list = {}; - fields.error_msg = handle_schematics.place_building_from_file( start_pos, end_pos, filename, replacement_list, "180", 3, 1, no_plotmarker, false, true ); + fields.error_msg = handle_schematics.place_building_from_file( start_pos, end_pos, filename, replacement_list, "180", 3, 1, no_plotmarker, false, true, pos ); if( fields.error_msg ) then fields.error_msg = 'Error: '..tostring( fields.error_msg ); minetest.chat_send_player( pname, fields.error_msg ); -- TODO: debug message diff --git a/place_buildings.lua b/place_buildings.lua index 9f774fb..60f2bb3 100644 --- a/place_buildings.lua +++ b/place_buildings.lua @@ -889,7 +889,7 @@ end -- places a building read from file "building_name" on the map between start_pos and end_pos using luavoxelmanip -- returns error message on failure and nil on success -handle_schematics.place_building_from_file = function( start_pos, end_pos, building_name, replacement_list, rotate, axis, mirror, no_plotmarker, keep_ground, scaffolding_only ) +handle_schematics.place_building_from_file = function( start_pos, end_pos, building_name, replacement_list, rotate, axis, mirror, no_plotmarker, keep_ground, scaffolding_only, plotmarker_pos ) --print ("scaffolding place_building_from_file: "..minetest.serialize( scaffolding_only )); if( not( building_name )) then return "No file name given. Cannot find the schematic."; @@ -1023,7 +1023,9 @@ handle_schematics.place_building_from_file = function( start_pos, end_pos, build meta:set_string( "infotext", "Dig the block below."); end -- store the position of the build chest so that npc can locate it more easily - meta:set_string( "chest_pos", inetest.pos_to_string( pos, 0 )); + if( plotmarker_pos ) then + meta:set_string( "chest_pos", minetest.pos_to_string( plotmarker_pos, 0 )); + end -- count them nodes_to_dig = nodes_to_dig + v.dig_down; end