From 9f3aec4df48c5edf643ac822e0812bf290721dca Mon Sep 17 00:00:00 2001 From: auria Date: Wed, 3 Mar 2010 00:10:38 +0000 Subject: [PATCH] Removed magic constant *blush* git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@4908 178a84e3-b1eb-0310-8ba1-8eac791a3b58 --- src/states_screens/kart_selection.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/states_screens/kart_selection.cpp b/src/states_screens/kart_selection.cpp index 633c770ea..006640442 100644 --- a/src/states_screens/kart_selection.cpp +++ b/src/states_screens/kart_selection.cpp @@ -48,6 +48,7 @@ using irr::core::stringw; const char* RANDOM_KART_ID = "randomkart"; const char* ALL_KART_GROUPS_ID = "all"; +const char* ID_DONT_USE = "x"; class PlayerKartWidget; @@ -1045,7 +1046,7 @@ void KartSelectionScreen::allPlayersDone() { if (items[n].m_code_name == RANDOM_KART_ID) { - items[n].m_code_name = "x"; // 'x' is the sentinel I use to mark an item as "don't use it" + items[n].m_code_name = ID_DONT_USE; break; } } @@ -1064,12 +1065,12 @@ void KartSelectionScreen::allPlayersDone() do { randomID = random.get(item_count); - if (items[randomID].m_code_name != "x") + if (items[randomID].m_code_name != ID_DONT_USE) { selection = items[randomID].m_code_name; done = true; } - items[randomID].m_code_name = "x"; // 'x' is the sentinel I use to mark an item as "don't use it" + items[randomID].m_code_name = ID_DONT_USE; } while (!done); } else @@ -1079,7 +1080,7 @@ void KartSelectionScreen::allPlayersDone() { if (items[i].m_code_name == items[n].m_code_name) { - items[i].m_code_name = "x"; // 'x' is the sentinel I use to mark an item as "don't use it" + items[i].m_code_name = ID_DONT_USE; break; } }