Skip to content

Commit

Permalink
Backporting CleverRaven#49762
Browse files Browse the repository at this point in the history
  • Loading branch information
ZhilkinSerg committed Aug 12, 2021
1 parent e615575 commit d326147
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/crafting_gui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -810,8 +810,15 @@ const recipe *select_crafting_recipe( int &batch_size_out )

if( subtab.cur() != "CSC_*_RECENT" ) {
std::stable_sort( current.begin(), current.end(),
[]( const recipe * a, const recipe * b ) {
return b->difficulty < a->difficulty;
[&player_character]( const recipe * a, const recipe * b ) {
if( b->difficulty != a->difficulty ) {
return b->difficulty < a->difficulty;
}
if( a->result_name() != b->result_name() ) {
return localized_compare( a->result_name(), b->result_name() );
}
return b->time_to_craft( player_character ) <
a->time_to_craft( player_character );
} );

std::stable_sort( current.begin(), current.end(),
Expand Down

0 comments on commit d326147

Please sign in to comment.