Clean up some minor coding style issues

This commit is contained in:
Guillaume P 2014-03-17 08:21:49 +01:00
parent b4fe033331
commit 45ab7e6907

View File

@ -457,30 +457,30 @@ void World::terminateRace()
Achievement *achiev = PlayerManager::getCurrentAchievementsStatus()->getAchievement(AchievementInfo::ACHIEVE_GOLD_DRIVER);
if (achiev)
{
std::string modeName = getIdent(); // Get the race mode name
int winnerPosition = 1;
std::string mode_name = getIdent(); // Get the race mode name
int winner_position = 1;
int opponents = achiev->getInfo()->getGoalValue("opponents"); // Get the required opponents number
if (modeName == IDENT_FTL)
if (mode_name == IDENT_FTL)
{
winnerPosition = 2;
winner_position = 2;
opponents++;
}
for(unsigned int i = 0; i < kart_amount ; i++)
for(unsigned int i = 0; i < kart_amount; i++)
{
// Retrieve the current player
StateManager::ActivePlayer* p = m_karts[i]->getController()->getPlayer();
if (p && p->getConstProfile() == PlayerManager::get()->getCurrentPlayer())
{
// Check if the player has won
if (m_karts[i]->getPosition() == winnerPosition && kart_amount > opponents )
if (m_karts[i]->getPosition() == winner_position && kart_amount > opponents )
{
// Update the achievement
modeName = StringUtils::toLowerCase(modeName);
mode_name = StringUtils::toLowerCase(mode_name);
if (achiev->getValue("opponents") <= 0)
PlayerManager::increaseAchievement(AchievementInfo::ACHIEVE_GOLD_DRIVER,
"opponents", opponents);
PlayerManager::increaseAchievement(AchievementInfo::ACHIEVE_GOLD_DRIVER,
modeName, 1);
mode_name, 1);
}
}
} // for i < kart_amount