Skip to content

Commit

Permalink
Don't swap loading screen
Browse files Browse the repository at this point in the history
  • Loading branch information
RenechCDDA committed Sep 13, 2024
1 parent d79a807 commit 91b7708
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/loading_ui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,10 @@ static void update_state( const std::string &context, const std::string &step )
} );

#ifdef TILES
static cata_path current_img;
std::vector<cata_path> imgs;
std::vector<mod_id> &active_mod_list = world_generator->active_world->active_mod_order;
for( auto &some_mod : active_mod_list ) {
for( mod_id &some_mod : active_mod_list ) {
const MOD_INFORMATION &mod = *some_mod;
for( std::string img_name : mod.loading_images ) {
// There may be more than one file matching the name, so we need to get all of them
Expand All @@ -107,8 +108,11 @@ static void update_state( const std::string &context, const std::string &step )
if( gLUI->chosen_load_img == cata_path() ) {
if( imgs.empty() ) {
gLUI->chosen_load_img = PATH_INFO::gfxdir() / "cdda.png"; //default load screen
} else {
} else if( !std::count( imgs.begin(), imgs.end(), gLUI->chosen_load_img ) ) {
current_img = cata_path();
gLUI->chosen_load_img = random_entry( imgs );
} else {
gLUI->chosen_load_img = current_img;
}
}
SDL_Surface_Ptr surf = load_image( gLUI->chosen_load_img.get_unrelative_path().u8string().c_str() );
Expand Down

0 comments on commit 91b7708

Please sign in to comment.