Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only list tilesets once #36896

Merged
merged 2 commits into from
Jan 10, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions src/options.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -916,12 +916,18 @@ std::vector<options_manager::id_and_option> options_manager::build_tilesets_list
std::vector<id_and_option> result;

// Load from data directory
auto data_tilesets = load_tilesets_from( PATH_INFO::gfxdir() );
std::vector<options_manager::id_and_option> data_tilesets = load_tilesets_from(
PATH_INFO::gfxdir() );
result.insert( result.end(), data_tilesets.begin(), data_tilesets.end() );

// Load from user directory
auto user_tilesets = load_tilesets_from( PATH_INFO::user_gfx() );
result.insert( result.end(), user_tilesets.begin(), user_tilesets.end() );
std::vector<options_manager::id_and_option> user_tilesets = load_tilesets_from(
PATH_INFO::user_gfx() );
for( options_manager::id_and_option id : user_tilesets ) {
if( std::find( result.begin(), result.end(), id ) == result.end() ) {
result.emplace_back( id );
}
}

// Default values
if( result.empty() ) {
Expand Down