mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2026-01-29 09:28:15 +03:00
Fix zip structure checks checking for wrong filename
It was checking for .vvv-mnt-temp-XXXXXX/LEVELNAME.vvvvvv instead of LEVELNAME.vvvvvv. When PhysFS enumerates the folder, it only gives us LEVELNAME.vvvvvv, and not .vvv-mnt-temp-XXXXXX/LEVELNAME.vvvvvv.
This commit is contained in:
@@ -359,6 +359,7 @@ static bool checkZipStructure(const char* filename)
|
|||||||
{
|
{
|
||||||
const char* real_dir = PHYSFS_getRealDir(filename);
|
const char* real_dir = PHYSFS_getRealDir(filename);
|
||||||
char base_name[MAX_PATH];
|
char base_name[MAX_PATH];
|
||||||
|
char base_name_suffixed[MAX_PATH];
|
||||||
char real_path[MAX_PATH];
|
char real_path[MAX_PATH];
|
||||||
char mount_path[MAX_PATH];
|
char mount_path[MAX_PATH];
|
||||||
char check_path[MAX_PATH];
|
char check_path[MAX_PATH];
|
||||||
@@ -392,18 +393,25 @@ static bool checkZipStructure(const char* filename)
|
|||||||
|
|
||||||
VVV_between(filename, "levels/", base_name, ".zip");
|
VVV_between(filename, "levels/", base_name, ".zip");
|
||||||
|
|
||||||
|
SDL_snprintf(
|
||||||
|
base_name_suffixed,
|
||||||
|
sizeof(base_name_suffixed),
|
||||||
|
"%s.vvvvvv",
|
||||||
|
base_name
|
||||||
|
);
|
||||||
|
|
||||||
SDL_snprintf(
|
SDL_snprintf(
|
||||||
check_path,
|
check_path,
|
||||||
sizeof(check_path),
|
sizeof(check_path),
|
||||||
"%s%s.vvvvvv",
|
"%s%s",
|
||||||
mount_path,
|
mount_path,
|
||||||
base_name
|
base_name_suffixed
|
||||||
);
|
);
|
||||||
|
|
||||||
success = PHYSFS_exists(check_path);
|
success = PHYSFS_exists(check_path);
|
||||||
|
|
||||||
SDL_zero(zip_state);
|
SDL_zero(zip_state);
|
||||||
zip_state.filename = check_path;
|
zip_state.filename = base_name_suffixed;
|
||||||
|
|
||||||
PHYSFS_enumerate(mount_path, zipCheckCallback, (void*) &zip_state);
|
PHYSFS_enumerate(mount_path, zipCheckCallback, (void*) &zip_state);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user