Properly reverse order when applying texture packs (#299)

This commit is contained in:
Tyler Wilding 2023-08-02 23:23:47 -06:00 committed by GitHub
parent 15ad8a57af
commit 504031a699
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 4 deletions

View file

@ -247,7 +247,11 @@ pub async fn update_texture_pack_data(
// Reset texture replacement directory
delete_dir(&game_texture_pack_dir)?;
create_dir(&game_texture_pack_dir)?;
for pack in config_lock.game_enabled_textured_packs(&game_name) {
for pack in config_lock
.game_enabled_textured_packs(&game_name)
.iter()
.rev()
{
let texture_pack_dir = install_path
.join("features")
.join(&game_name)

View file

@ -119,9 +119,6 @@ pub fn check_if_zip_contains_top_level_dir(
let mut zip = zip::ZipArchive::new(reader)?;
for i in 0..zip.len() {
let file = zip.by_index(i)?;
if !file.is_dir() {
continue;
}
// Check if the entry is a directory and has the desired folder name
if file.name().starts_with(&expected_dir) {
return Ok(true);