@@ -2115,6 +2115,11 @@ bool WORLD::set_compression_enabled( bool enabled ) const
2115
2115
2116
2116
std::vector<cata_path> dimension_folders = get_directories ( world_folder_path / " dimensions" );
2117
2117
dimension_folders.push_back ( world_folder_path );
2118
+
2119
+ copy_file ( maps_dict, world_folder_path / " maps.dict" );
2120
+ copy_file ( overmaps_dict, world_folder_path / " overmaps.dict" );
2121
+ copy_file ( mmr_dict, world_folder_path / " mmr.dict" );
2122
+
2118
2123
for ( const cata_path &dimension_folder : dimension_folders ) {
2119
2124
{
2120
2125
std::vector<cata_path> maps_folders = get_directories ( dimension_folder / " maps" );
@@ -2247,9 +2252,7 @@ bool WORLD::set_compression_enabled( bool enabled ) const
2247
2252
files_to_clean.push_back ( save );
2248
2253
}
2249
2254
}
2250
- copy_file ( maps_dict, dimension_folder / " maps.dict" );
2251
- copy_file ( overmaps_dict, dimension_folder / " overmaps.dict" );
2252
- copy_file ( mmr_dict, dimension_folder / " mmr.dict" );
2255
+
2253
2256
size_t done = 0 ;
2254
2257
size_t to_do = folders_to_clean.size () + files_to_clean.size ();
2255
2258
for ( const cata_path &folder : folders_to_clean ) {
@@ -2273,10 +2276,13 @@ bool WORLD::set_compression_enabled( bool enabled ) const
2273
2276
} else {
2274
2277
std::vector<cata_path> dimension_folders = get_directories ( world_folder_path / " dimensions" );
2275
2278
dimension_folders.push_back ( world_folder_path );
2279
+
2280
+ cata_path maps_dict = world_folder_path / " maps.dict" ;
2281
+ cata_path overmaps_dict = world_folder_path / " overmaps.dict" ;
2282
+ cata_path mmr_dict = world_folder_path / " mmr.dict" ;
2283
+
2276
2284
for ( const cata_path &dimension_folder : dimension_folders ) {
2277
- cata_path maps_dict = dimension_folder / " maps.dict" ;
2278
- cata_path overmaps_dict = dimension_folder / " overmaps.dict" ;
2279
- cata_path mmr_dict = dimension_folder / " mmr.dict" ;
2285
+
2280
2286
std::vector<cata_path> zzips_to_clean;
2281
2287
2282
2288
std::vector<cata_path> maps_zzips = get_files_from_path ( " zzip" , dimension_folder / " maps" , false ,
@@ -2389,31 +2395,6 @@ bool WORLD::set_compression_enabled( bool enabled ) const
2389
2395
return true ;
2390
2396
}
2391
2397
2392
- // For dimension stuff
2393
- void WORLD::assure_compression_files_present () const
2394
- {
2395
- // Check if there's compression enabled in the save file
2396
- if ( has_compression_enabled () ) {
2397
- // Make sure the dimension folder actually exists before doing checks on it
2398
- assure_dir_exist ( PATH_INFO::current_dimension_save_path () );
2399
- // Check if we're not overwriting already pre-existing .dict files
2400
- if ( !std::filesystem::exists ( ( PATH_INFO::current_dimension_save_path () /
2401
- " maps.dict" ).get_unrelative_path () ) ||
2402
- !std::filesystem::exists ( ( PATH_INFO::current_dimension_save_path () /
2403
- " mmr.dict" ).get_unrelative_path () ) ||
2404
- !std::filesystem::exists ( ( PATH_INFO::current_dimension_save_path () /
2405
- " overmaps.dict" ).get_unrelative_path () ) ) {
2406
- cata_path dictionary_folder = PATH_INFO::compression_folder_path ();
2407
- cata_path maps_dict = dictionary_folder / " maps.dict" ;
2408
- cata_path mmr_dict = dictionary_folder / " mmr.dict" ;
2409
- cata_path overmaps_dict = dictionary_folder / " overmaps.dict" ;
2410
- copy_file ( maps_dict, PATH_INFO::current_dimension_save_path () / " maps.dict" );
2411
- copy_file ( mmr_dict, PATH_INFO::current_dimension_save_path () / " mmr.dict" );
2412
- copy_file ( overmaps_dict, PATH_INFO::current_dimension_save_path () / " overmaps.dict" );
2413
- }
2414
- }
2415
- }
2416
-
2417
2398
mod_manager &worldfactory::get_mod_manager ()
2418
2399
{
2419
2400
return *mman;
0 commit comments