From ba7cde0869aecee2e4efcfcee099a6c3f7be229f Mon Sep 17 00:00:00 2001 From: KorGgenT Date: Fri, 15 Nov 2019 20:54:06 -0500 Subject: [PATCH] add extra capabilities to mutation copy-from --- src/mutation_data.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/mutation_data.cpp b/src/mutation_data.cpp index 83b0551f1d335..e615551c8c4ba 100644 --- a/src/mutation_data.cpp +++ b/src/mutation_data.cpp @@ -18,6 +18,7 @@ using TraitGroupMap = std::map>; using TraitSet = std::set; +using trait_reader = auto_flags_reader; TraitSet trait_blacklist; TraitGroupMap trait_groups; @@ -380,14 +381,14 @@ void mutation_branch::load( JsonObject &jo, const std::string & ) /* Not currently supported due to inability to save active mutation state load_mutation_mods(jsobj, "active_mods", new_mut.mods); */ - optional( jo, was_loaded, "prereqs", prereqs ); - optional( jo, was_loaded, "prereqs2", prereqs2 ); - optional( jo, was_loaded, "threshreq", threshreq ); - optional( jo, was_loaded, "cancels", cancels ); - optional( jo, was_loaded, "changes_to", replacements ); - optional( jo, was_loaded, "leads_to", additions ); - optional( jo, was_loaded, "flags", flags ); - optional( jo, was_loaded, "types", types ); + optional( jo, was_loaded, "prereqs", prereqs, trait_reader{} ); + optional( jo, was_loaded, "prereqs2", prereqs2, trait_reader{} ); + optional( jo, was_loaded, "threshreq", threshreq, trait_reader{} ); + optional( jo, was_loaded, "cancels", cancels, trait_reader{} ); + optional( jo, was_loaded, "changes_to", replacements, trait_reader{} ); + optional( jo, was_loaded, "leads_to", additions, trait_reader{} ); + optional( jo, was_loaded, "flags", flags, string_reader{} ); + optional( jo, was_loaded, "types", types, string_reader{} ); JsonArray jsar = jo.get_array( "no_cbm_on_bp" ); while( jsar.has_more() ) {