better support for citybuilder
This commit is contained in:
parent
173890d4e2
commit
30c505a16e
@ -86,9 +86,14 @@ handle_schematics.analyze_file = function( file_name, origin_offset, store_as_mt
|
||||
-- print error message only if all import methods failed
|
||||
if( not( res )) then
|
||||
print('[handle_schematics] ERROR: Failed to import file \"'..tostring( file_name )..'\"[.mts|.we|.wem|.schematic]');
|
||||
return;
|
||||
-- convert to .mts for later usage
|
||||
elseif( store_as_mts ) then
|
||||
handle_schematics.store_mts_file( store_as_mts, res );
|
||||
res = handle_schematics.analyze_mts_file( file_name );
|
||||
if( not( res )) then
|
||||
return;
|
||||
end
|
||||
end
|
||||
|
||||
-- .we and .schematic do not provide on_construct/after_palce_node
|
||||
|
@ -57,12 +57,19 @@ build_chest.end_pos_list = {};
|
||||
|
||||
|
||||
|
||||
build_chest.read_building = function( building_name )
|
||||
build_chest.read_building = function( building_name, building_data )
|
||||
if( not( building_data )) then
|
||||
building_data = {};
|
||||
end
|
||||
if( not( build_chest.building[ building_name ] )) then
|
||||
build_chest.building[ building_name ] = building_data;
|
||||
end
|
||||
-- read data
|
||||
local res = handle_schematics.analyze_file( building_name, nil, nil );
|
||||
local res = handle_schematics.analyze_file( building_name, nil, nil, build_chest.building[ building_name ]);
|
||||
if( not( res )) then
|
||||
return;
|
||||
end
|
||||
--[[
|
||||
build_chest.building[ building_name ].size = res.size;
|
||||
build_chest.building[ building_name ].nodenames = res.nodenames;
|
||||
build_chest.building[ building_name ].rotated = res.rotated;
|
||||
@ -73,7 +80,8 @@ build_chest.read_building = function( building_name )
|
||||
build_chest.building[ building_name ].bed_list = res.bed_list;
|
||||
-- scm_data_cache is not stored as that would take up too much storage space
|
||||
--build_chest.building[ building_name ].scm_data_cache = res.scm_data_cache;
|
||||
|
||||
--]]
|
||||
build_chest.building[ building_name ] = res;
|
||||
-- create a statistic about how often each node occours
|
||||
build_chest.building[ building_name ].statistic = handle_schematics.count_nodes( res );
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user