diff --git a/src/samples/ghhb_game.h b/src/samples/ghhb_game.h index 030970a..c697e18 100644 --- a/src/samples/ghhb_game.h +++ b/src/samples/ghhb_game.h @@ -343,8 +343,10 @@ public: bool music_loaded = false; std::vector chart; std::vector spawned; + std::unordered_set completed_notes_history; std::unordered_set completed_notes; std::unordered_set missed_notes; + std::unordered_set missed_notes_history; std::vector pending_sounds; std::vector active_sustained; bool instrument_has_hits[MAX_INSTRUMENT_TYPES] = {false}; @@ -583,6 +585,7 @@ public: if (it != spawned.end()) { hit_flash_timer[n->lane] = PRESS_FLASH_DURATION; + completed_notes_history.insert(n); completed_notes.insert(n); // n.time is when the bottom should hit the line float bottom_hits_line_time = n->time + chart_time_offset; @@ -753,10 +756,14 @@ public: if (!has_hits) continue; float bottom_y = glyph_bottom_y(*n); - if (bottom_y > hit_line_y + HIT_ZONE_MARGIN) + if (bottom_y > hit_line_y + HIT_ZONE_MARGIN && + std::find(completed_notes_history.begin(), completed_notes_history.end(), n) == completed_notes_history.end() && + std::find(missed_notes_history.begin(), missed_notes_history.end(), n) == missed_notes_history.end() + ) { + missed_notes_history.insert(n); missed_notes.insert(n); - TraceLog(LOG_WARNING, "COMBO RESET -> 0 (missed note: lane %d, inst %d, is_auto=%d, has_hits=%d, PHYSICAL_GP[%d]=%d)", + TraceLog(LOG_WARNING, "COMBO RESET0 -> 0 (missed note: lane %d, inst %d, is_auto=%d, has_hits=%d, PHYSICAL_GP[%d]=%d)", n->lane, n->instrument_slot, is_auto, has_hits, n->instrument_slot, INSTRUMENT_PHYSICAL_GAMEPAD[n->instrument_slot]); combo = 0; } @@ -843,7 +850,7 @@ public: } else { - TraceLog(LOG_WARNING, "COMBO RESET -> 0 (lane %d pressed but no valid note found)", lane); + TraceLog(LOG_WARNING, "COMBO RESET2 -> 0 (lane %d pressed but no valid note found)", lane); combo = 0; score = std::max(0, score - 25); }