@@ -215,8 +215,7 @@ void CPellets::add_group(
215215 Subpixel vel_x;
216216 Subpixel vel_y;
217217
218- // Should be >=, but yeah, it's just an inconsequential oversight.
219- if (alive_count > PELLET_COUNT ) {
218+ if (alive_count >= PELLET_COUNT ) {
220219 return ;
221220 }
222221 if (
@@ -263,8 +262,7 @@ void CPellets::add_single(
263262 Subpixel vel_x;
264263 Subpixel vel_y;
265264
266- // Should be >=, but yeah, it's just an inconsequential oversight.
267- if (alive_count > PELLET_COUNT ) {
265+ if (alive_count >= PELLET_COUNT ) {
268266 return ;
269267 }
270268 speed_set (speed_base);
@@ -591,19 +589,31 @@ void CPellets::unput_update_render(void)
591589 }
592590}
593591
594- void CPellets::unput_and_reset (void )
592+ void CPellets::unput_and_reset_nonclouds (void )
595593{
596594 p = iteration_start ();
597595 for (int i = 0 ; i < PELLET_COUNT ; i++, p++) {
596+ // ZUN quirk: This condition skips the reset for active delay clouds,
597+ // i.e., pellets where (([moving] == false) && ([cloud_frame] > 0)).
598+ // These continue their delay animation after this function and
599+ // eventually turn into regular pellets. In most cases, that doesn't
600+ // matter because this is the final pellet-related method to be called
601+ // before the process restarts, but it does make a difference in
602+ // exactly two places:
603+ //
604+ // • The "TAMA DEL" command on the debug screen
605+ // • Sariel's second form, where this is the exact reason why some
606+ // pellets are carried over from the first to the second form
598607 if (!p->moving ) {
599608 continue ;
600609 }
610+
601611 p_sloppy_wide_unput_at_cur_pos ();
602612 p->decay_frame = 0 ;
603613 p->moving = false ;
604614 p->cloud_frame = 0 ;
615+ alive_count--;
605616 }
606- alive_count = 0 ;
607617}
608618
609619void CPellets::decay (void )
@@ -620,18 +630,20 @@ void CPellets::decay(void)
620630 }
621631}
622632
623- void CPellets::reset (void )
633+ void CPellets::reset_nonclouds (void )
624634{
625635 p = iteration_start ();
626636 for (int i = 0 ; i < PELLET_COUNT ; i++, p++) {
637+ // ZUN quirk: Same as in unput_and_reset_nonclouds().
627638 if (!p->moving ) {
628639 continue ;
629640 }
641+
630642 p->moving = false ;
631643 p->decay_frame = 0 ;
632644 p->cloud_frame = 0 ;
645+ alive_count--;
633646 }
634- alive_count = 0 ;
635647}
636648
637649bool CPellets::hittest_player_for_cur (void )
0 commit comments