From 802d70ca8d7f50adc0d39e28ef56984cd1b8e2c8 Mon Sep 17 00:00:00 2001 From: Geoffrey Mon Date: Wed, 2 Aug 2017 17:21:37 -0400 Subject: [PATCH] Fix code style issues --- src/karts/controller/controller.cpp | 3 ++- src/karts/controller/ghost_controller.hpp | 7 +++--- src/replay/replay_play.cpp | 28 ++++++++++++----------- 3 files changed, 21 insertions(+), 17 deletions(-) diff --git a/src/karts/controller/controller.cpp b/src/karts/controller/controller.cpp index 6460b0341..26d8311d2 100644 --- a/src/karts/controller/controller.cpp +++ b/src/karts/controller/controller.cpp @@ -35,6 +35,7 @@ Controller::Controller(AbstractKart *kart) setControllerName("Controller"); } // Controller -core::stringw Controller::getName() const { +core::stringw Controller::getName() const +{ return translations->fribidize(m_kart->getName()); } diff --git a/src/karts/controller/ghost_controller.hpp b/src/karts/controller/ghost_controller.hpp index 746d95544..245abae74 100644 --- a/src/karts/controller/ghost_controller.hpp +++ b/src/karts/controller/ghost_controller.hpp @@ -77,9 +77,10 @@ public: { return m_current_index; } // ------------------------------------------------------------------------ /** Return the display name; if not set, use default display name (kart name) */ - core::stringw getName() const OVERRIDE { return m_display_name.empty() ? - Controller::getName() : - m_display_name; } + core::stringw getName() const OVERRIDE + { + return m_display_name.empty() ? Controller::getName() : m_display_name; + } }; // GhostController #endif diff --git a/src/replay/replay_play.cpp b/src/replay/replay_play.cpp index 130dbad0a..923374af9 100644 --- a/src/replay/replay_play.cpp +++ b/src/replay/replay_play.cpp @@ -142,21 +142,23 @@ bool ReplayPlay::addReplayFile(const std::string& fn, bool custom_replay) { Log::warn("Replay", "Could not read ghost karts info!"); break; - } else { - rd.m_kart_list.push_back(std::string(s1)); + } - if (scanned == 2) { - // If username of kart is present, use it - rd.m_name_list.push_back(StringUtils::xmlDecode(std::string(display_name_encoded))); - if (rd.m_name_list.size() == 1) { - // First user is the game master and the "owner" of this replay file - rd.m_user_name = rd.m_name_list[0]; - } - } else { // scanned == 1 - // If username is not present, kart display name will default to kart name - // (see GhostController::getName) - rd.m_name_list.push_back(""); + rd.m_kart_list.push_back(std::string(s1)); + if (scanned == 2) + { + // If username of kart is present, use it + rd.m_name_list.push_back(StringUtils::xmlDecode(std::string(display_name_encoded))); + if (rd.m_name_list.size() == 1) + { + // First user is the game master and the "owner" of this replay file + rd.m_user_name = rd.m_name_list[0]; } + } else + { // scanned == 1 + // If username is not present, kart display name will default to kart name + // (see GhostController::getName) + rd.m_name_list.push_back(""); } }