diff --git a/common/include/physfsx.h b/common/include/physfsx.h index 03a5c4743..2e173e1a1 100644 --- a/common/include/physfsx.h +++ b/common/include/physfsx.h @@ -387,8 +387,6 @@ static inline void PHYSFSX_readMatrix(const char *const filename, const unsigned #define PHYSFSX_readMatrix(M,F) ((PHYSFSX_readMatrix)(__FILE__, __LINE__, __func__, (M), (F))) -#define PHYSFSX_contfile_close PHYSFSX_removeRelFromSearchPath - class PHYSFS_File_deleter { public: @@ -444,7 +442,7 @@ enum class physfs_search_path : int }; int PHYSFSX_addRelToSearchPath(const char *relname, std::array &realPath, physfs_search_path); -extern int PHYSFSX_removeRelFromSearchPath(const char *relname); +void PHYSFSX_removeRelFromSearchPath(const char *relname); extern int PHYSFSX_fsize(const char *hogname); extern void PHYSFSX_listSearchPathContent(); int PHYSFSX_getRealPath(const char *stdPath, std::array &realPath); diff --git a/similar/main/mission.cpp b/similar/main/mission.cpp index 02d84c82a..7097bc22d 100644 --- a/similar/main/mission.cpp +++ b/similar/main/mission.cpp @@ -1019,7 +1019,7 @@ static const char *load_mission(const mle *const mission) } #if defined(DXX_BUILD_DESCENT_II) else - PHYSFSX_contfile_close("descent.hog"); + PHYSFSX_removeRelFromSearchPath("descent.hog"); #endif #if defined(DXX_BUILD_DESCENT_II) diff --git a/similar/misc/physfsx.cpp b/similar/misc/physfsx.cpp index 12181186a..a2ff53e79 100644 --- a/similar/misc/physfsx.cpp +++ b/similar/misc/physfsx.cpp @@ -309,7 +309,7 @@ int PHYSFSX_addRelToSearchPath(const char *relname, std::array & return r; } -int PHYSFSX_removeRelFromSearchPath(const char *relname) +void PHYSFSX_removeRelFromSearchPath(const char *relname) { char relname2[PATH_MAX]; @@ -320,14 +320,13 @@ int PHYSFSX_removeRelFromSearchPath(const char *relname) if (!PHYSFSX_getRealPath(relname2, pathname)) { con_printf(CON_DEBUG, "PHYSFS: ignoring unmap request: no canonical path for relative name \"%s\"", relname2); - return 0; + return; } auto r = PHYSFS_unmount(pathname.data()); if (r) con_printf(CON_DEBUG, "PHYSFS: unmap canonical directory \"%s\" (relative name \"%s\")", pathname.data(), relname); else con_printf(CON_VERBOSE, "PHYSFS: failed to unmap canonical directory \"%s\" (relative name \"%s\"): \"%s\"", pathname.data(), relname, PHYSFS_getLastError()); - return r; } int PHYSFSX_fsize(const char *hogname)