|
From: Tapio V. <aa...@us...> - 2010-08-23 21:18:30
|
Module: performous
Branch: master
Commit: 5d50d15d643589232e40603378747f483e1cd4ee
Author: Tapio Vierros <tap...@gm...>
Date: Tue Aug 24 00:17:16 2010 +0300
Fix bug in joinmenu current difficulty determination during menu setup.
---
game/guitargraph.cc | 11 +++++------
1 files changed, 5 insertions(+), 6 deletions(-)
diff --git a/game/guitargraph.cc b/game/guitargraph.cc
index 8df4f45..9e81b4f 100644
--- a/game/guitargraph.cc
+++ b/game/guitargraph.cc
@@ -144,11 +144,11 @@ void GuitarGraph::setupJoinMenu() {
// Create track option only for guitars
if (!m_drums) {
ConfigItem::OptionList ol;
- int i = 0, cur = 0;
+ int cur = 0;
// Add tracks to option list
- for (InstrumentTracksConstPtr::const_iterator it = m_instrumentTracks.begin(); it != m_instrumentTracks.end(); ++it, ++i) {
+ for (InstrumentTracksConstPtr::const_iterator it = m_instrumentTracks.begin(); it != m_instrumentTracks.end(); ++it) {
ol.push_back(it->first);
- if (m_track_index->first == it->first) cur = i; // Find the index of current track
+ if (m_track_index->first == it->first) cur = ol.size()-1; // Find the index of current track
}
m_selectedTrack = ConfigItem(ol); // Create a ConfigItem from the option list
m_selectedTrack.select(cur); // Set the selection to current track
@@ -157,13 +157,12 @@ void GuitarGraph::setupJoinMenu() {
}
{ // Create difficulty opt
ConfigItem::OptionList ol;
- int i = 0, cur = 0;
+ int cur = 0;
// Add difficulties to the option list
for (int level = 0; level < DIFFICULTYCOUNT; ++level) {
if (difficulty(Difficulty(level), true)) {
ol.push_back(boost::lexical_cast<std::string>(level));
- if (Difficulty(i) == m_level) cur = i;
- ++i;
+ if (Difficulty(level) == m_level) cur = ol.size()-1;
}
}
m_selectedDifficulty = ConfigItem(ol); // Create a ConfigItem from the option list
|