Clean up some minor coding style issues
This commit is contained in:
parent
b4fe033331
commit
45ab7e6907
@ -457,30 +457,30 @@ void World::terminateRace()
|
|||||||
Achievement *achiev = PlayerManager::getCurrentAchievementsStatus()->getAchievement(AchievementInfo::ACHIEVE_GOLD_DRIVER);
|
Achievement *achiev = PlayerManager::getCurrentAchievementsStatus()->getAchievement(AchievementInfo::ACHIEVE_GOLD_DRIVER);
|
||||||
if (achiev)
|
if (achiev)
|
||||||
{
|
{
|
||||||
std::string modeName = getIdent(); // Get the race mode name
|
std::string mode_name = getIdent(); // Get the race mode name
|
||||||
int winnerPosition = 1;
|
int winner_position = 1;
|
||||||
int opponents = achiev->getInfo()->getGoalValue("opponents"); // Get the required opponents number
|
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++;
|
opponents++;
|
||||||
}
|
}
|
||||||
for(unsigned int i = 0; i < kart_amount ; i++)
|
for(unsigned int i = 0; i < kart_amount; i++)
|
||||||
{
|
{
|
||||||
// Retrieve the current player
|
// Retrieve the current player
|
||||||
StateManager::ActivePlayer* p = m_karts[i]->getController()->getPlayer();
|
StateManager::ActivePlayer* p = m_karts[i]->getController()->getPlayer();
|
||||||
if (p && p->getConstProfile() == PlayerManager::get()->getCurrentPlayer())
|
if (p && p->getConstProfile() == PlayerManager::get()->getCurrentPlayer())
|
||||||
{
|
{
|
||||||
// Check if the player has won
|
// 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
|
// Update the achievement
|
||||||
modeName = StringUtils::toLowerCase(modeName);
|
mode_name = StringUtils::toLowerCase(mode_name);
|
||||||
if (achiev->getValue("opponents") <= 0)
|
if (achiev->getValue("opponents") <= 0)
|
||||||
PlayerManager::increaseAchievement(AchievementInfo::ACHIEVE_GOLD_DRIVER,
|
PlayerManager::increaseAchievement(AchievementInfo::ACHIEVE_GOLD_DRIVER,
|
||||||
"opponents", opponents);
|
"opponents", opponents);
|
||||||
PlayerManager::increaseAchievement(AchievementInfo::ACHIEVE_GOLD_DRIVER,
|
PlayerManager::increaseAchievement(AchievementInfo::ACHIEVE_GOLD_DRIVER,
|
||||||
modeName, 1);
|
mode_name, 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} // for i < kart_amount
|
} // for i < kart_amount
|
||||||
|
Loading…
Reference in New Issue
Block a user