|
From: Tapio V. <aa...@us...> - 2009-11-08 08:31:01
|
Module: performous
Branch: dance
Commit: 155603f268a0cc2dc2abeb9cd019b9f78620d559
Author: Tapio Vierros <tap...@gm...>
Date: Sun Nov 1 18:15:57 2009 +0200
Assume that an instrument difficulty level that has only one chord is broken (so don't show it).
---
game/guitargraph.cc | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/game/guitargraph.cc b/game/guitargraph.cc
index a0704b1..edafa3b 100644
--- a/game/guitargraph.cc
+++ b/game/guitargraph.cc
@@ -323,8 +323,14 @@ bool GuitarGraph::difficulty(Difficulty level) {
int fail = 0;
for (int fret = 0; fret < 5; ++fret) if (nm.find(basepitch + fret) == nm.end()) ++fail;
if (fail == 5) return false;
+ Difficulty prevLevel = m_level;
m_level = level;
updateChords();
+ if (m_chords.size() <= 1) { // If there is only one chord, it's probably b0rked
+ m_level = prevLevel;
+ updateChords();
+ return false;
+ }
return true;
}
|