From e711f20edb92b8cd33f036fba80199316dc6d4f6 Mon Sep 17 00:00:00 2001 From: Alayan-stk-2 Date: Sun, 5 Aug 2018 03:17:38 +0200 Subject: [PATCH] Fix #3234 (#3367) --- src/replay/replay_play.cpp | 2 ++ src/replay/replay_play.hpp | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/replay/replay_play.cpp b/src/replay/replay_play.cpp index 6207cf77d..b7986b05c 100644 --- a/src/replay/replay_play.cpp +++ b/src/replay/replay_play.cpp @@ -252,6 +252,8 @@ bool ReplayPlay::addReplayFile(const std::string& fn, bool custom_replay, int ca return false; } + rd.m_track = t; + fgets(s, 1023, fd); if (sscanf(s, "laps: %u", &rd.m_laps) != 1) { diff --git a/src/replay/replay_play.hpp b/src/replay/replay_play.hpp index 830665831..2a476a72f 100644 --- a/src/replay/replay_play.hpp +++ b/src/replay/replay_play.hpp @@ -20,6 +20,7 @@ #define HEADER_REPLAY__PLAY_HPP #include "replay/replay_base.hpp" +#include "tracks/track.hpp" #include "irrString.h" #include @@ -57,6 +58,7 @@ public: public: std::string m_filename; std::string m_track_name; + Track* m_track; std::string m_minor_mode; core::stringw m_stk_version; core::stringw m_user_name; @@ -76,7 +78,7 @@ public: switch (m_sort_order) { case SO_TRACK: - return m_track_name < r.m_track_name; + return m_track->getSortName() < r.m_track->getSortName(); break; case SO_KART_NUM: return m_kart_list.size() < r.m_kart_list.size();