Skip to content

Commit

Permalink
Clean up some minor coding style issues
Browse files Browse the repository at this point in the history
  • Loading branch information
gupascal committed Mar 17, 2014
1 parent b4fe033 commit 45ab7e6
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/modes/world.cpp
Expand Up @@ -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
Expand Down

0 comments on commit 45ab7e6

Please sign in to comment.