From 385f108b163891e184f3562bc77033079f1f1589 Mon Sep 17 00:00:00 2001 From: Csaba Molnar Date: Sat, 15 Mar 2014 00:38:16 +0100 Subject: [PATCH 1/3] Skidding achievement --- data/achievements.xml | 4 ++++ src/achievements/achievement_info.hpp | 2 +- src/karts/skidding.cpp | 3 +++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/data/achievements.xml b/data/achievements.xml index 1cfd510fa..feb017a98 100644 --- a/data/achievements.xml +++ b/data/achievements.xml @@ -25,5 +25,9 @@ title="Marathoner" description="Make a race with 5 laps or more"> + + + diff --git a/src/achievements/achievement_info.hpp b/src/achievements/achievement_info.hpp index 6b8bab458..65dae7772 100644 --- a/src/achievements/achievement_info.hpp +++ b/src/achievements/achievement_info.hpp @@ -47,7 +47,7 @@ public: ACHIEVE_STRIKE = 2, ACHIEVE_ARCH_ENEMY = 3, ACHIEVE_MARATHONER = 4, - ACHIEVE_LAST = ACHIEVE_MARATHONER + ACHIEVE_SKIDDING = 5 }; /** Achievement check type: * ALL_AT_LEAST: All goal values must be reached (or exceeded). diff --git a/src/karts/skidding.cpp b/src/karts/skidding.cpp index 93137fe4d..94e517fc1 100644 --- a/src/karts/skidding.cpp +++ b/src/karts/skidding.cpp @@ -21,6 +21,8 @@ #ifdef SKID_DEBUG # include "graphics/show_curve.hpp" #endif +#include "achievements/achievement_info.hpp" +#include "config\player_manager.hpp" #include "karts/kart.hpp" #include "karts/kart_gfx.hpp" #include "karts/kart_properties.hpp" @@ -412,6 +414,7 @@ void Skidding::update(float dt, bool is_on_ground, bonus_speed, bonus_speed, bonus_force, bonus_time, /*fade-out-time*/ 1.0f); + PlayerManager::increaseAchievement(AchievementInfo::ACHIEVE_SKIDDING, "skidding"); } else { m_kart->getKartGFX() From bc3850ebdb8dca4dbd12f456d1d9fb6afc314e7a Mon Sep 17 00:00:00 2001 From: Csaba Molnar Date: Sat, 15 Mar 2014 19:18:03 +0100 Subject: [PATCH 2/3] Wrong include corrected (\ -> /). Drift counting fixed. --- src/karts/skidding.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/karts/skidding.cpp b/src/karts/skidding.cpp index 94e517fc1..c6e0d7720 100644 --- a/src/karts/skidding.cpp +++ b/src/karts/skidding.cpp @@ -22,7 +22,7 @@ # include "graphics/show_curve.hpp" #endif #include "achievements/achievement_info.hpp" -#include "config\player_manager.hpp" +#include "config/player_manager.hpp" #include "karts/kart.hpp" #include "karts/kart_gfx.hpp" #include "karts/kart_properties.hpp" @@ -414,7 +414,12 @@ void Skidding::update(float dt, bool is_on_ground, bonus_speed, bonus_speed, bonus_force, bonus_time, /*fade-out-time*/ 1.0f); - PlayerManager::increaseAchievement(AchievementInfo::ACHIEVE_SKIDDING, "skidding"); + + StateManager::ActivePlayer *c = m_kart->getController()->getPlayer(); + if (c && c->getConstProfile() == PlayerManager::get()->getCurrentPlayer()) + { + PlayerManager::increaseAchievement(AchievementInfo::ACHIEVE_SKIDDING, "skidding"); + } } else { m_kart->getKartGFX() From c175f2450e2045a7c14cdd4bdc2b0ce179a189c6 Mon Sep 17 00:00:00 2001 From: Csaba Molnar Date: Sat, 15 Mar 2014 19:58:25 +0100 Subject: [PATCH 3/3] Tab fix --- src/achievements/achievement_info.hpp | 2 +- src/karts/skidding.cpp | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/achievements/achievement_info.hpp b/src/achievements/achievement_info.hpp index 65dae7772..5e52989bf 100644 --- a/src/achievements/achievement_info.hpp +++ b/src/achievements/achievement_info.hpp @@ -47,7 +47,7 @@ public: ACHIEVE_STRIKE = 2, ACHIEVE_ARCH_ENEMY = 3, ACHIEVE_MARATHONER = 4, - ACHIEVE_SKIDDING = 5 + ACHIEVE_SKIDDING = 5 }; /** Achievement check type: * ALL_AT_LEAST: All goal values must be reached (or exceeded). diff --git a/src/karts/skidding.cpp b/src/karts/skidding.cpp index c6e0d7720..0751bb68d 100644 --- a/src/karts/skidding.cpp +++ b/src/karts/skidding.cpp @@ -415,11 +415,11 @@ void Skidding::update(float dt, bool is_on_ground, bonus_force, bonus_time, /*fade-out-time*/ 1.0f); - StateManager::ActivePlayer *c = m_kart->getController()->getPlayer(); - if (c && c->getConstProfile() == PlayerManager::get()->getCurrentPlayer()) - { - PlayerManager::increaseAchievement(AchievementInfo::ACHIEVE_SKIDDING, "skidding"); - } + StateManager::ActivePlayer *c = m_kart->getController()->getPlayer(); + if (c && c->getConstProfile() == PlayerManager::get()->getCurrentPlayer()) + { + PlayerManager::increaseAchievement(AchievementInfo::ACHIEVE_SKIDDING, "skidding"); + } } else { m_kart->getKartGFX()