store zero strain values
This commit is contained in:
+2
-1
@@ -1,6 +1,7 @@
|
|||||||
## Upcoming
|
## Upcoming
|
||||||
|
|
||||||
Nothing as of now
|
- __Adjustments:__
|
||||||
|
- Specified clock rates can go below 0.001 again
|
||||||
|
|
||||||
# v0.9.4 (2023-02-09)
|
# v0.9.4 (2023-02-09)
|
||||||
|
|
||||||
|
|||||||
+3
-3
@@ -222,9 +222,9 @@ fn calculate_movement(params: CatchStars<'_>) -> (Movement, CatchDifficultyAttri
|
|||||||
// If final values don't coincide perfectly anymore,
|
// If final values don't coincide perfectly anymore,
|
||||||
// this should be looked at and maybe adjusted.
|
// this should be looked at and maybe adjusted.
|
||||||
if movement.curr_section_peak.abs() <= f64::EPSILON && base_time > curr_section_end {
|
if movement.curr_section_peak.abs() <= f64::EPSILON && base_time > curr_section_end {
|
||||||
let remaining = base_time - curr_section_end;
|
let remaining_time = base_time - curr_section_end;
|
||||||
let skip_iter_count = (remaining / SECTION_LENGTH).ceil();
|
let remaining_iters = (remaining_time / SECTION_LENGTH).ceil();
|
||||||
curr_section_end += skip_iter_count * SECTION_LENGTH;
|
curr_section_end += remaining_iters * SECTION_LENGTH;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -38,9 +38,9 @@ pub(crate) trait StrainSkill: Sized + Skill {
|
|||||||
if self.curr_section_peak().abs() <= f64::EPSILON
|
if self.curr_section_peak().abs() <= f64::EPSILON
|
||||||
&& curr.start_time > self.curr_section_end()
|
&& curr.start_time > self.curr_section_end()
|
||||||
{
|
{
|
||||||
let remaining = curr.start_time - self.curr_section_end();
|
let remaining_time = curr.start_time - self.curr_section_end();
|
||||||
let skip_iter_count = (remaining / SECTION_LEN).ceil();
|
let remaining_iters = (remaining_time / SECTION_LEN).ceil();
|
||||||
*self.curr_section_end_mut() += skip_iter_count * SECTION_LEN;
|
*self.curr_section_end_mut() += remaining_iters * SECTION_LEN;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -55,9 +55,9 @@ pub(crate) trait StrainSkill: Skill + Sized {
|
|||||||
if self.curr_section_peak().abs() <= f64::EPSILON
|
if self.curr_section_peak().abs() <= f64::EPSILON
|
||||||
&& curr.start_time > *self.curr_section_end()
|
&& curr.start_time > *self.curr_section_end()
|
||||||
{
|
{
|
||||||
let remaining = curr.start_time - *self.curr_section_end();
|
let remaining_time = curr.start_time - *self.curr_section_end();
|
||||||
let skip_iter_count = (remaining / SECTION_LEN).ceil();
|
let remaining_iters = (remaining_time / SECTION_LEN).ceil();
|
||||||
*self.curr_section_end() += skip_iter_count * SECTION_LEN;
|
*self.curr_section_end() += remaining_iters * SECTION_LEN;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -48,9 +48,11 @@ pub(crate) trait StrainSkill: Skill {
|
|||||||
if self.curr_section_peak().abs() <= f64::EPSILON
|
if self.curr_section_peak().abs() <= f64::EPSILON
|
||||||
&& curr.start_time > *self.curr_section_end()
|
&& curr.start_time > *self.curr_section_end()
|
||||||
{
|
{
|
||||||
let remaining = curr.start_time - *self.curr_section_end();
|
let remaining_time = curr.start_time - *self.curr_section_end();
|
||||||
let skip_iter_count = (remaining / SECTION_LEN).ceil();
|
let remaining_iters = (remaining_time / SECTION_LEN).ceil();
|
||||||
*self.curr_section_end() += skip_iter_count * SECTION_LEN;
|
*self.curr_section_end() += remaining_iters * SECTION_LEN;
|
||||||
|
self.strain_peaks_mut()
|
||||||
|
.push_n_zeros(remaining_iters as usize);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user