diff --git a/plugins/blueprint.cpp b/plugins/blueprint.cpp index b08f4d074..361aaa1ca 100644 --- a/plugins/blueprint.cpp +++ b/plugins/blueprint.cpp @@ -1285,7 +1285,7 @@ static void add_processor(vector &processors, static bool do_transform(color_ostream &out, const df::coord &start, const df::coord &end, - const blueprint_options &opts, + blueprint_options &opts, vector &filenames) { // empty map instances to pass to emplace() below static const bp_area EMPTY_AREA; @@ -1358,17 +1358,24 @@ static bool do_transform(color_ostream &out, } } - std::map output_files; std::vector meta_phases; for (blueprint_processor &processor : processors) { if (processor.mapdata.empty() && !processor.force_create) continue; if (is_meta_phase(out, opts, processor.phase)) meta_phases.push_back(processor.phase); + } + if (meta_phases.size() <= 1) + opts.nometa = true; + + std::map output_files; + for (blueprint_processor &processor : processors) { + if (processor.mapdata.empty() && !processor.force_create) + continue; if (!write_blueprint(out, output_files, opts, processor, pretty)) break; } - if (meta_phases.size()) { + if (!opts.nometa) { write_meta_blueprint(out, output_files, opts, meta_phases); }