diff --git a/src/faction.cpp b/src/faction.cpp index 88755156ceb65..58203db0f22e2 100644 --- a/src/faction.cpp +++ b/src/faction.cpp @@ -113,7 +113,7 @@ faction_template::faction_template( const JsonObject &jsobj ) } lone_wolf_faction = jsobj.get_bool( "lone_wolf_faction", false ); load_relations( jsobj ); - mon_faction = jsobj.get_string( "mon_faction", "human" ); + mon_faction = mfaction_str_id( jsobj.get_string( "mon_faction", "human" ) ); for( const JsonObject jao : jsobj.get_array( "epilogues" ) ) { epilogue_data.emplace( jao.get_int( "power_min", std::numeric_limits::min() ), jao.get_int( "power_max", std::numeric_limits::max() ), diff --git a/src/faction.h b/src/faction.h index 7cccd9f122163..0521f2eb20b1c 100644 --- a/src/faction.h +++ b/src/faction.h @@ -89,7 +89,7 @@ class faction_template bool lone_wolf_faction; // is this a faction for just one person? itype_id currency; // id of the faction currency std::map> relations; - std::string mon_faction; // mon_faction_id of the monster faction; defaults to human + mfaction_str_id mon_faction; // mon_faction_id of the monster faction; defaults to human std::set> epilogue_data; }; diff --git a/src/npc.cpp b/src/npc.cpp index a6ac6b3df588b..1d549475e7cc3 100644 --- a/src/npc.cpp +++ b/src/npc.cpp @@ -2959,9 +2959,8 @@ std::set npc::get_path_avoid() const mfaction_id npc::get_monster_faction() const { if( my_fac ) { - string_id my_mon_fac = string_id( my_fac->mon_faction ); - if( my_mon_fac.is_valid() ) { - return my_mon_fac; + if( my_fac->mon_faction.is_valid() ) { + return my_fac->mon_faction; } }