Skip to content

Commit

Permalink
fix: fix terrain shadow ctd when directory does not exist (#869)
Browse files Browse the repository at this point in the history
  • Loading branch information
Pentalimbed authored Dec 17, 2024
1 parent 8887cb7 commit e4d2a67
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Features/TerrainShadows.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,8 @@ void TerrainShadows::SetupResources()
logger::debug("Listing xLODGen height maps...");
{
std::filesystem::path texture_dir{ L"Data\\textures\\Terrain\\" };
for (auto const& dir_entry : std::filesystem::directory_iterator{ texture_dir }) {
std::error_code ec;
for (auto const& dir_entry : std::filesystem::directory_iterator{ texture_dir, ec }) {
auto dir_path = dir_entry.path();
if (!std::filesystem::is_directory(dir_path))
continue;
Expand All @@ -147,7 +148,8 @@ void TerrainShadows::SetupResources()
logger::debug("Listing height maps...");
{
std::filesystem::path texture_dir{ L"Data\\textures\\heightmaps\\" };
for (auto const& dir_entry : std::filesystem::directory_iterator{ texture_dir })
std::error_code ec;
for (auto const& dir_entry : std::filesystem::directory_iterator{ texture_dir, ec })
ParseHeightmapPath(dir_entry.path(), false);
}

Expand Down

0 comments on commit e4d2a67

Please sign in to comment.