|
From: Tapio V. <aa...@us...> - 2009-12-15 11:47:34
|
Module: performous
Branch: master
Commit: ea5083c2bfbf97b51dbada61559dd72ac39d3fcc
Author: Tapio Vierros <tap...@gm...>
Date: Tue Dec 15 13:45:11 2009 +0200
Two bug fixes for instruments.
* Fixed a bug in hold releasing introduced by previous 'fix'.
* Drum streak counter now resets if whole chord wasn't played.
---
game/guitargraph.cc | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/game/guitargraph.cc b/game/guitargraph.cc
index 4775d21..5313784 100644
--- a/game/guitargraph.cc
+++ b/game/guitargraph.cc
@@ -174,6 +174,8 @@ void GuitarGraph::engine() {
}
// Skip missed notes
while (m_chordIt != m_chords.end() && m_chordIt->begin + maxTolerance < time) {
+ if ( (m_drums && m_chordIt->status != m_chordIt->polyphony)
+ || (!m_drums && m_chordIt->status == 0) ) endStreak();
++m_chordIt;
++m_dead;
}
@@ -246,6 +248,9 @@ void GuitarGraph::endHold(int fret, double time) {
void GuitarGraph::fail(double time, int fret) {
std::cout << "MISS" << std::endl;
if (fret == -2) return; // Tapped note
+ if (fret == -1) {
+ for (int i = 0; i < 5; ++i) endHold(i, time);
+ }
if (m_starpower.get() < 0.01) {
m_events.push_back(Event(time, 0, fret));
if (fret < 0) fret = std::rand();
@@ -302,7 +307,6 @@ void GuitarGraph::guitarPlay(double time, input::Event const& ev) {
if (picked) {
for (int fret = 0; fret < 5; ++fret) {
frets[fret] = ev.pressed[fret];
- endHold(fret);
}
} else {
if (m_correctness.get() < 0.5 && m_starpower.get() < 0.001) return; // Hammering not possible at the moment
|