FileSystem: Check PHYSFS_registerArchiver() for success

This commit is contained in:
Jonas Kulla 2019-05-18 16:48:17 +02:00
parent 98bdfcf758
commit 86194118a3
1 changed files with 9 additions and 4 deletions

View File

@ -325,13 +325,18 @@ FileSystem::FileSystem(const char *argv0,
if (PHYSFS_init(argv0) == 0)
throwPhysfsError("Error initializing PhysFS");
/* One error (=return 0) turns the whole product to 0 */
int er = 1;
er *= PHYSFS_registerArchiver(&RGSS1_Archiver);
er *= PHYSFS_registerArchiver(&RGSS2_Archiver);
er *= PHYSFS_registerArchiver(&RGSS3_Archiver);
if (er == 0)
throwPhysfsError("Error registering PhysFS RGSS archiver");
p = new FileSystemPrivate;
p->havePathCache = false;
PHYSFS_registerArchiver(&RGSS1_Archiver);
PHYSFS_registerArchiver(&RGSS2_Archiver);
PHYSFS_registerArchiver(&RGSS3_Archiver);
if (allowSymlinks)
PHYSFS_permitSymbolicLinks(1);
}