From 984ff6dc47288b6a30a321b13183d785432ac98d Mon Sep 17 00:00:00 2001 From: Raphael Setin Date: Sun, 23 Apr 2017 10:42:08 -0400 Subject: [PATCH] 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. --- src/openrct2/ride/TrackDesignRepository.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/openrct2/ride/TrackDesignRepository.cpp b/src/openrct2/ride/TrackDesignRepository.cpp index 5c9ceb8f99..922713daa3 100644 --- a/src/openrct2/ride/TrackDesignRepository.cpp +++ b/src/openrct2/ride/TrackDesignRepository.cpp @@ -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; } };