···111111 DistributionType::Wave => {
112112 let mut modified_value = dist_value;
113113 if let Some(offset) = last_data_offset {
114114- modified_value -= offset;
114114+ modified_value = (modified_value - offset).max(0.0);
115115 }
116116117117 let mut fraction = filtered_id / filtered_size;
···548548 assert_eq!(
549549 DistributionType::Step.compute_both(i, 12, &filter, 1.0, None, None),
550550 i as f32
551551+ );
552552+ }
553553+ }
554554+555555+ #[test]
556556+ fn wave_with_value_less_than_data_offset() {
557557+ for i in 0..12 {
558558+ assert_eq!(
559559+ DistributionType::Wave.compute_both(
560560+ i,
561561+ 12,
562562+ &Filter::default(),
563563+ 1.0,
564564+ Some(2.0),
565565+ None
566566+ ),
567567+ 0.0
551568 );
552569 }
553570 }
+6-1
src/difficulty/lightshow/filter.rs
···115115 }
116116 }
117117118118+ #[allow(deprecated)]
118119 /// Returns the number of light chunks effected by the filter, but before applying the limit.
119119- ///
120120 /// This is required for distribution calculations.
121121+ ///
122122+ /// Also see [`count_filtered`](Self::count_filtered).
121123 /// # Unknown
122124 /// If the [`FilterType`] is `Unknown` then the result will be the same as `group_size`.
123125 #[must_use]
···144146 }
145147 }
146148149149+ #[allow(deprecated)]
147150 /// Returns the number of light chunks effected by the filter.
151151+ ///
152152+ /// Also see [`count_filtered_without_limit`](Self::count_filtered_without_limit).
148153 /// # Unknown
149154 /// If the [`FilterType`] is `Unknown` then the result will be the same as `group_size`.
150155 #[must_use]