Skip to content

Commit

Permalink
PackageManager::LoadMap(): Add the file extension if it is missing.
Browse files Browse the repository at this point in the history
  • Loading branch information
LupertEverett authored and dpjudas committed Nov 19, 2024
1 parent 5faa67d commit a06a8ee
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions SurrealEngine/Package/PackageManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ std::unique_ptr<Package> PackageManager::LoadMap(const std::string& path)
// Only one of the above is most likely true. Lets begin with assuming its relative to the Maps folder.
std::string name = FilePath::remove_extension(FilePath::last_component(path));
std::string absolute_path = FilePath::relative_to_absolute_from_system(FilePath::combine(launchInfo.gameRootFolder, "Maps"), path);
// Add the file extension if it is missing
if (!FilePath::has_extension(absolute_path, GetMapExtension().c_str()))
absolute_path += "." + GetMapExtension();
return std::make_unique<Package>(this, name, absolute_path);
}

Expand Down

0 comments on commit a06a8ee

Please sign in to comment.