1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-15 11:03:00 +01:00

Read until first dot when converting track file name to in-game name, fixes #5077

This commit addresses the bug of Goliath.1 track. The track name will be everything that is written in the file name of that track, until the first dot.
This commit is contained in:
Raphael Setin
2017-04-23 10:42:08 -04:00
committed by Michael Steenbeek
parent 6e41508bad
commit 984ff6dc47

View File

@@ -346,7 +346,10 @@ private:
public:
static std::string GetNameFromTrackPath(const std::string &path)
{
return Path::GetFileNameWithoutExtension(path);
std::string name = Path::GetFileNameWithoutExtension(path);
//The track name should be the file name until the first instance of a dot
name = name.substr(0, name.find_first_of("."));
return name;
}
};