Skip to content

Commit

Permalink
remove shit
Browse files Browse the repository at this point in the history
  • Loading branch information
2278535805 committed Feb 8, 2025
1 parent 2bbf12b commit 6c25983
Showing 1 changed file with 18 additions and 16 deletions.
34 changes: 18 additions & 16 deletions prpr/src/judge.rs
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,7 @@ impl JudgeInner {
pub mod inner;
#[cfg(feature = "closed")]
use inner::*;
use crate::core::Note;

#[repr(C)]
pub struct Judge {
Expand Down Expand Up @@ -557,31 +558,32 @@ impl Judge {
}
}
if let (Some((line_id, id)), dist, dt, _, posx) = closest {
let unattr_drag = &chart.lines.iter_mut().any(|line| { // Check drag in good range & not flag
line.notes.iter_mut().any(|note| {
let x = &mut note.object.translation.0;
x.set_time(t);
let dist2 = (x.now() - posx).abs();
let dist = (dist2 - dist).abs();
let judge_time = t - note.time;
matches!(note.kind, NoteKind::Drag | NoteKind::Flick) && dist <= X_DIFF_MAX && matches!(note.fake, false) && !note.attr && judge_time >= -LIMIT_GOOD && judge_time <= LIMIT_BAD
})
let drag_or_flick = |note: &mut Note| {
let x = &mut note.object.translation.0;
x.set_time(t);
let dist2 = (x.now() - posx).abs();
let dist = (dist2 - dist).abs();
let judge_time = t - note.time;
matches!(note.kind, NoteKind::Drag | NoteKind::Flick)
&& dist <= X_DIFF_MAX
&& !note.fake
&& !note.attr
&& judge_time >= -LIMIT_GOOD
&& judge_time <= LIMIT_BAD
};
let unattr_drag = chart.lines.iter_mut().any(|line| {
line.notes.iter_mut().any(|note| drag_or_flick(note))
});
let line = &mut chart.lines[line_id];
if matches!(line.notes[id as usize].kind, NoteKind::Drag) {
// debug!("reject by drag");
continue;
}
if click {
if *unattr_drag && dt > LIMIT_PERFECT { // flag drag
if unattr_drag && dt > LIMIT_PERFECT { // flag drag
for line in &mut chart.lines {
for note in &mut line.notes {
let x = &mut note.object.translation.0;
x.set_time(t);
let dist2 = (x.now() - posx).abs();
let dist = (dist2 - dist).abs();
let judge_time = t - note.time;
if matches!(note.kind, NoteKind::Drag | NoteKind::Flick) && dist <= X_DIFF_MAX && matches!(note.fake, false) && !note.attr && judge_time >= -LIMIT_GOOD && judge_time <= LIMIT_BAD { //LIMIT_PERFECT * 0.25
if drag_or_flick(note) {
note.attr = true;
// debug!("flag drag");
}
Expand Down

0 comments on commit 6c25983

Please sign in to comment.