Fix bug #557 by deactivating challenge orbs when the player doesn't have enough points for them

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@10719 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
auria
2012-01-25 02:09:10 +00:00
parent 870d5c05aa
commit ec0a20c319
3 changed files with 9 additions and 2 deletions

View File

@@ -87,7 +87,9 @@ void OverWorld::onFirePressed(Controller* who)
Vec3 kart_xyz = getKart(0)->getXYZ();
for (unsigned int n=0; n<challenges.size(); n++)
{
if ((kart_xyz - Vec3(challenges[n].m_position)).length2_2d() < 20)
if (challenges[n].m_force_field.m_is_locked) continue;
if ((kart_xyz - Vec3(challenges[n].m_position)).length2_2d() < CHALLENGE_DISTANCE_SQUARED)
{
core::rect<s32> pos(15,
10,

View File

@@ -338,7 +338,9 @@ void RaceGUIOverworld::drawGlobalMiniMap()
// ---- Draw nearby challenge if any
for (unsigned int n=0; n<challenges.size(); n++)
{
if ((kart_xyz - Vec3(challenges[n].m_position)).length2_2d() < 20)
if (challenges[n].m_force_field.m_is_locked) continue;
if ((kart_xyz - Vec3(challenges[n].m_position)).length2_2d() < CHALLENGE_DISTANCE_SQUARED)
{
core::rect<s32> pos(15,
10,

View File

@@ -36,6 +36,9 @@ class Material;
class RaceSetup;
class ChallengeData;
/** Distance (squared) at which a challenge orb "activates" */
const int CHALLENGE_DISTANCE_SQUARED = 20;
/**
* \brief Handles the in-race GUI (messages, mini-map, rankings, timer, etc...)
* \ingroup states_screens