really provide the build_chest position to the dig-here-indicators

This commit is contained in:
Sokomine 2017-04-03 21:44:22 +02:00
parent 4bc37abbd8
commit 331eb28d3b
2 changed files with 6 additions and 4 deletions

View File

@ -702,7 +702,7 @@ mirror = nil;
if( not( minetest.check_player_privs( pname, {creative=true}))) then if( not( minetest.check_player_privs( pname, {creative=true}))) then
use_scaffolding = true; use_scaffolding = true;
end 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 if( fields.error_msg ) then
fields.error_msg = 'Error: '..tostring( fields.error_msg ); fields.error_msg = 'Error: '..tostring( fields.error_msg );
end end
@ -732,7 +732,7 @@ mirror = nil;
local axis = build_chest.building[ building_name ].axis; local axis = build_chest.building[ building_name ].axis;
local no_plotmarker = true; local no_plotmarker = true;
local replacement_list = {}; 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 if( fields.error_msg ) then
fields.error_msg = 'Error: '..tostring( fields.error_msg ); fields.error_msg = 'Error: '..tostring( fields.error_msg );
minetest.chat_send_player( pname, fields.error_msg ); -- TODO: debug message minetest.chat_send_player( pname, fields.error_msg ); -- TODO: debug message

View File

@ -889,7 +889,7 @@ end
-- places a building read from file "building_name" on the map between start_pos and end_pos using luavoxelmanip -- 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 -- 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 )); --print ("scaffolding place_building_from_file: "..minetest.serialize( scaffolding_only ));
if( not( building_name )) then if( not( building_name )) then
return "No file name given. Cannot find the schematic."; 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."); meta:set_string( "infotext", "Dig the block below.");
end end
-- store the position of the build chest so that npc can locate it more easily -- 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 -- count them
nodes_to_dig = nodes_to_dig + v.dig_down; nodes_to_dig = nodes_to_dig + v.dig_down;
end end