|
From: Tapio V. <aa...@us...> - 2010-08-22 09:14:11
|
Module: performous
Branch: master
Commit: 8ba42c6941de410615f3b567d7a4524701818429
Author: Tapio Vierros <tap...@gm...>
Date: Sun Aug 22 12:11:55 2010 +0300
OptionList loops around since drums don't have "select backwards" option in join menu.
---
game/configuration.cc | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/game/configuration.cc b/game/configuration.cc
index 24a70e5..5e37c29 100644
--- a/game/configuration.cc
+++ b/game/configuration.cc
@@ -42,7 +42,8 @@ ConfigItem& ConfigItem::incdec(int dir) {
bool& val = boost::get<bool>(m_value);
val = !val;
} else if (m_type == "option_list") {
- m_sel = clamp<int>(m_sel + dir, 0, boost::get<OptionList>(m_value).size()-1);
+ size_t s = boost::get<OptionList>(m_value).size();
+ m_sel = (m_sel + dir + s) % s;
}
return *this;
}
|