Fix code style issues

This commit is contained in:
Geoffrey Mon 2017-08-02 17:21:37 -04:00
parent 9ec2ff5c4a
commit 802d70ca8d
3 changed files with 21 additions and 17 deletions

View File

@ -35,6 +35,7 @@ Controller::Controller(AbstractKart *kart)
setControllerName("Controller"); setControllerName("Controller");
} // Controller } // Controller
core::stringw Controller::getName() const { core::stringw Controller::getName() const
{
return translations->fribidize(m_kart->getName()); return translations->fribidize(m_kart->getName());
} }

View File

@ -77,9 +77,10 @@ public:
{ return m_current_index; } { return m_current_index; }
// ------------------------------------------------------------------------ // ------------------------------------------------------------------------
/** Return the display name; if not set, use default display name (kart name) */ /** Return the display name; if not set, use default display name (kart name) */
core::stringw getName() const OVERRIDE { return m_display_name.empty() ? core::stringw getName() const OVERRIDE
Controller::getName() : {
m_display_name; } return m_display_name.empty() ? Controller::getName() : m_display_name;
}
}; // GhostController }; // GhostController
#endif #endif

View File

@ -142,21 +142,23 @@ bool ReplayPlay::addReplayFile(const std::string& fn, bool custom_replay)
{ {
Log::warn("Replay", "Could not read ghost karts info!"); Log::warn("Replay", "Could not read ghost karts info!");
break; break;
} else { }
rd.m_kart_list.push_back(std::string(s1));
if (scanned == 2) { rd.m_kart_list.push_back(std::string(s1));
// If username of kart is present, use it if (scanned == 2)
rd.m_name_list.push_back(StringUtils::xmlDecode(std::string(display_name_encoded))); {
if (rd.m_name_list.size() == 1) { // If username of kart is present, use it
// First user is the game master and the "owner" of this replay file rd.m_name_list.push_back(StringUtils::xmlDecode(std::string(display_name_encoded)));
rd.m_user_name = rd.m_name_list[0]; if (rd.m_name_list.size() == 1)
} {
} else { // scanned == 1 // First user is the game master and the "owner" of this replay file
// If username is not present, kart display name will default to kart name rd.m_user_name = rd.m_name_list[0];
// (see GhostController::getName)
rd.m_name_list.push_back("");
} }
} 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("");
} }
} }