Skip to content

Commit

Permalink
Character randomization sometimes produces 'crossdressing' characters (
Browse files Browse the repository at this point in the history
  • Loading branch information
RenechCDDA authored Oct 4, 2024
1 parent 0c8023e commit 34aab02
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/newcharacter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4547,7 +4547,11 @@ void set_description( tab_manager &tabs, avatar &you, const bool allow_reroll,
} else if( action == "RANDOMIZE_CHAR_DESCRIPTION" ) {
bool gender_selection = one_in( 2 );
you.male = gender_selection;
outfit = gender_selection;
if( one_in( 10 ) ) {
outfit = !gender_selection;
} else {
outfit = gender_selection;
}
if( !MAP_SHARING::isSharing() ) { // Don't allow random names when sharing maps. We don't need to check at the top as you won't be able to edit the name
you.pick_name();
no_name_entered = you.name.empty();
Expand Down Expand Up @@ -4907,6 +4911,7 @@ void avatar::save_template( const std::string &name, pool_type pool )
if( !random_start_location ) {
jsout.member( "start_location", start_location );
}
jsout.member( "outfit_gender", outfit );
jsout.end_object();

serialize( jsout );
Expand Down Expand Up @@ -4939,6 +4944,8 @@ bool avatar::load_template( const std::string &template_name, pool_type &pool )
random_start_location = jobj.get_bool( "random_start_location", true );
const std::string jobj_start_location = jobj.get_string( "start_location", "" );

outfit = jobj.get_bool( "outfit_gender", true );

// get_scenario()->allowed_start( loc.ident() ) is checked once scenario loads in avatar::load()
for( const class start_location &loc : start_locations::get_all() ) {
if( loc.id.str() == jobj_start_location ) {
Expand Down

0 comments on commit 34aab02

Please sign in to comment.