diff --git a/data/json/professions.json b/data/json/professions.json index 9a3ffcaa3c658..200aa1ab53d26 100644 --- a/data/json/professions.json +++ b/data/json/professions.json @@ -3304,7 +3304,10 @@ "type": "profession", "id": "reenactor", "name": { "male": "Historical Reenactor", "female": "Ahistorical Reenactor" }, - "description": "You were on your way to the Annual All New England Revolutionary War Living History exhibition when the end of the world permanently derailed your plans.", + "description": { + "male": "You were on your way to the Annual All New England Revolutionary War Living History exhibition when the end of the world permanently derailed your plans.", + "female": "You were on your way to the Annual All New England Revolutionary War Living History exhibition when the end of the world made traditional gender roles obsolete." + }, "points": 3, "proficiencies": [ "prof_gunsmithing_basic", "prof_metalworking", "prof_gunsmithing_antique" ], "skills": [ @@ -3348,7 +3351,10 @@ "type": "profession", "id": "reenactor2", "name": { "male": "Ahistorical Reenactor", "female": "Historical Reenactor" }, - "description": "You were on your way to the Annual All New England Revolutionary War Living History exhibition when the end of the world made traditional gender roles obsolete.", + "description": { + "male": "You were on your way to the Annual All New England Revolutionary War Living History exhibition when the end of the world made traditional gender roles obsolete.", + "female": "You were on your way to the Annual All New England Revolutionary War Living History exhibition when the end of the world permanently derailed your plans." + }, "points": 3, "proficiencies": [ "prof_spinning", "prof_closures", "prof_knitting" ], "skills": [ diff --git a/src/profession.cpp b/src/profession.cpp index 3d0e3c3f7e107..bf3046e92f9ab 100644 --- a/src/profession.cpp +++ b/src/profession.cpp @@ -166,11 +166,31 @@ void profession::load( const JsonObject &jo, const std::string & ) if( !was_loaded || jo.has_member( "description" ) ) { std::string desc; - mandatory( jo, false, "description", desc, text_style_check_reader() ); + std::string desc_male; + std::string desc_female; + + bool use_default_description = true; + if( jo.has_object( "description" ) ) { + JsonObject desc_obj = jo.get_object( "description" ); + desc_obj.allow_omitted_members(); + + if( desc_obj.has_member( "male" ) && desc_obj.has_member( "female" ) ) { + use_default_description = false; + mandatory( desc_obj, false, "male", desc_male, text_style_check_reader() ); + mandatory( desc_obj, false, "female", desc_female, text_style_check_reader() ); + } + } + + if( use_default_description ) { + mandatory( jo, false, "description", desc, text_style_check_reader() ); + desc_male = desc; + desc_female = desc; + } // These also may differ depending on the language settings! - _description_male = to_translation( "prof_desc_male", desc ); - _description_female = to_translation( "prof_desc_female", desc ); + _description_male = to_translation( "prof_desc_male", desc_male ); + _description_female = to_translation( "prof_desc_female", desc_female ); } + if( jo.has_string( "vehicle" ) ) { _starting_vehicle = vproto_id( jo.get_string( "vehicle" ) ); }