Skip to content

Commit

Permalink
Check if userdir "levels" directory exists, before re-mounting it
Browse files Browse the repository at this point in the history
  • Loading branch information
Vankata453 authored Jan 31, 2024
1 parent 88674c6 commit 4d102d3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/supertux/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,9 @@ void PhysfsSubsystem::remount_datadir_static() const
add_data_to_search_path("shader");

// Re-mount levels from the user directory
if (!PHYSFS_mount(FileSystem::join(m_userdir, "levels").c_str(), "levels", 0))
const std::string userdir_levels = FileSystem::join(m_userdir, "levels");
if (FileSystem::exists(userdir_levels) &&
!PHYSFS_mount(userdir_levels.c_str(), "levels", 0))
{
log_warning << "Couldn't mount levels from the user directory '" << m_userdir << "' to PhysFS searchpath: " << PHYSFS_getErrorByCode(PHYSFS_getLastErrorCode()) << std::endl;
}
Expand Down

0 comments on commit 4d102d3

Please sign in to comment.