updated osu's clockrate bugfix

mania: updated to osu's clockrate bugfix

taiko: updated to osu's clockrate bugfix

fruits: updated to osu's clockrate bugfix
This commit is contained in:
MaxOhn
2021-08-09 11:39:12 +02:00
parent dc3486201f
commit cc8c893866
12 changed files with 65 additions and 55 deletions
+3
View File
@@ -7,6 +7,7 @@ pub(crate) struct DifficultyObject<'o> {
pub(crate) last: &'o CatchObject,
pub(crate) delta: f32,
pub(crate) start_time: f32,
pub(crate) normalized_pos: f32,
pub(crate) last_normalized_pos: f32,
@@ -24,6 +25,7 @@ impl<'o> DifficultyObject<'o> {
clock_rate: f32,
) -> Self {
let delta = (base.time - last.time) / clock_rate;
let start_time = base.time / clock_rate;
let strain_time = delta.max(40.0);
let scaling_factor = NORMALIZED_HITOBJECT_RADIUS / half_catcher_width;
@@ -34,6 +36,7 @@ impl<'o> DifficultyObject<'o> {
base,
last,
delta,
start_time,
normalized_pos,
last_normalized_pos,
strain_time,
+4 -4
View File
@@ -227,7 +227,7 @@ pub fn stars(map: &Beatmap, mods: impl Mods, passed_objects: Option<usize>) -> S
while h.base.time > current_section_end {
movement.save_current_peak();
movement.start_new_section_from(current_section_end);
movement.start_new_section_from(current_section_end / attributes.clock_rate);
current_section_end += section_len;
}
@@ -247,7 +247,7 @@ pub fn stars(map: &Beatmap, mods: impl Mods, passed_objects: Option<usize>) -> S
while h.base.time > current_section_end {
movement.save_current_peak();
movement.start_new_section_from(current_section_end);
movement.start_new_section_from(current_section_end / attributes.clock_rate);
current_section_end += section_len;
}
@@ -451,7 +451,7 @@ pub fn strains(map: &Beatmap, mods: impl Mods) -> Strains {
while h.base.time > current_section_end {
movement.save_current_peak();
movement.start_new_section_from(current_section_end);
movement.start_new_section_from(current_section_end / attributes.clock_rate);
current_section_end += section_len;
}
@@ -471,7 +471,7 @@ pub fn strains(map: &Beatmap, mods: impl Mods) -> Strains {
while h.base.time > current_section_end {
movement.save_current_peak();
movement.start_new_section_from(current_section_end);
movement.start_new_section_from(current_section_end / attributes.clock_rate);
current_section_end += section_len;
}
+1 -1
View File
@@ -59,7 +59,7 @@ impl Movement {
self.current_strain *= strain_decay(current.delta);
self.current_strain += self.strain_value_of(&current) * SKILL_MULTIPLIER;
self.current_section_peak = self.current_strain.max(self.current_section_peak);
self.prev_time.replace(current.base.time);
self.prev_time.replace(current.start_time);
}
pub(crate) fn difficulty_value(&mut self) -> f32 {
+4 -2
View File
@@ -74,7 +74,7 @@ pub fn stars(map: &Beatmap, mods: impl Mods, passed_objects: Option<usize>) -> S
for h in hit_objects {
while h.base.start_time > current_section_end {
strain.save_current_peak();
strain.start_new_section_from(current_section_end);
strain.start_new_section_from(current_section_end / clock_rate);
current_section_end += section_len;
}
@@ -126,7 +126,7 @@ pub fn strains(map: &Beatmap, mods: impl Mods) -> Strains {
for h in hit_objects {
while h.base.start_time > current_section_end {
strain.save_current_peak();
strain.start_new_section_from(current_section_end);
strain.start_new_section_from(current_section_end / clock_rate);
current_section_end += section_len;
}
@@ -147,6 +147,7 @@ pub(crate) struct DifficultyHitObject<'o> {
base: &'o HitObject,
column: usize,
delta: f32,
start_time: f32,
}
impl<'o> DifficultyHitObject<'o> {
@@ -159,6 +160,7 @@ impl<'o> DifficultyHitObject<'o> {
base,
column,
delta: (base.start_time - prev.start_time) / clock_rate,
start_time: base.start_time / clock_rate,
}
}
}
+1 -1
View File
@@ -67,7 +67,7 @@ impl Strain {
self.current_strain *= self.strain_decay(current.delta);
self.current_strain += self.strain_value_of(&current) * SKILL_MULTIPLIER;
self.current_section_peak = self.current_strain.max(self.current_section_peak);
self.prev_time.replace(current.base.start_time);
self.prev_time.replace(current.start_time);
}
fn strain_value_of(&mut self, current: &DifficultyHitObject) -> f32 {
+2
View File
@@ -8,6 +8,7 @@ pub(crate) struct DifficultyObject<'o> {
pub(crate) prev: &'o HitObject,
pub(crate) delta: f32,
pub(crate) rhythm: &'static HitObjectRhythm,
pub(crate) start_time: f32,
}
impl<'o> DifficultyObject<'o> {
@@ -28,6 +29,7 @@ impl<'o> DifficultyObject<'o> {
prev,
delta,
rhythm,
start_time: base.start_time / clock_rate,
}
}
}
+2 -2
View File
@@ -84,7 +84,7 @@ pub fn stars(map: &Beatmap, mods: impl Mods, passed_objects: Option<usize>) -> S
while h.base.start_time > current_section_end {
for skill in skills.iter_mut() {
skill.save_current_peak();
skill.start_new_section_from(current_section_end);
skill.start_new_section_from(current_section_end / clock_rate);
}
current_section_end += section_len;
@@ -172,7 +172,7 @@ pub fn strains(map: &Beatmap, mods: impl Mods) -> Strains {
while h.base.start_time > current_section_end {
for skill in skills.iter_mut() {
skill.save_current_peak();
skill.start_new_section_from(current_section_end);
skill.start_new_section_from(current_section_end / clock_rate);
}
current_section_end += section_len;
+1 -1
View File
@@ -53,7 +53,7 @@ impl Skill {
self.current_strain +=
self.kind.strain_value_of(&current, cheese) * self.skill_multiplier();
self.current_section_peak = self.current_section_peak.max(self.current_strain);
self.prev_time.replace(current.base.start_time);
self.prev_time.replace(current.start_time);
}
#[inline]