|
From: Tapio V. <aa...@us...> - 2010-01-14 20:14:47
|
Module: performous
Branch: master
Commit: a20690da7f20887e147fc899b0dbf78e219a3c00
Author: Tapio Vierros <tap...@gm...>
Date: Thu Jan 14 22:11:08 2010 +0200
Fix issue with sometimes not being able to hit dance notes near holds.
---
game/dancegraph.cc | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/game/dancegraph.cc b/game/dancegraph.cc
index 3d158f1..ad78a3b 100644
--- a/game/dancegraph.cc
+++ b/game/dancegraph.cc
@@ -284,8 +284,8 @@ void DanceGraph::dance(double time, input::Event const& ev) {
}
std::cout << "Hit button " << ev.button << " at " << time << std::endl;
- for (DanceNotes::iterator it = m_notesIt; it != m_notes.end() && time <= it->note.begin + maxTolerance; it++) {
- if(!it->isHit && time >= it->note.begin - maxTolerance && ev.button == it->note.note) {
+ for (DanceNotes::iterator it = m_notesIt; it != m_notes.end() && time <= it->note.end + maxTolerance; it++) {
+ if(!it->isHit && std::abs(time - it->note.begin) <= maxTolerance && ev.button == it->note.note) {
it->isHit = true;
if (it->note.type != Note::MINE) {
it->score = points(it->note.begin - time);
|