Skip to content

Conversation

@taherbert
Copy link
Contributor

Summary

The Meteoric Rise tick callback uses an integer division algorithm that always evaluates to true, spawning a soul fragment on every tick instead of distributing N fragments across M ticks.

With 4 ticks and 3 target fragments: ticks_per_soul_fragment = 4/3 = 1 (int), 4 % 1 == 0 → always true → 4 fragments instead of 3.

Fix

Replace with integer boundary crossing that distributes exactly N fragments across M ticks:

int expected_before = ( d->current_tick - 1 ) * soul_fragments_from_meteoric_rise / d->num_ticks();
int expected_after  = d->current_tick * soul_fragments_from_meteoric_rise / d->num_ticks();
if ( expected_after > expected_before )

Verified: current_tick is 1-based (incremented at dot.cpp:1079 before tick() at line 1092), tick_on_application = false for Fel Devastation. With 4 ticks/3 fragments: spawns on ticks 2, 3, 4 (total 3). With 6 ticks/3 fragments: spawns on ticks 2, 4, 6 (evenly spaced).

The tick() method used d->num_ticks() (a constant) in both the
division and modulo, making the spawn condition always true.
With 4 ticks and 3 target fragments: 4/3=1, 4%1=0 -> always true,
spawning 4 fragments instead of 3.

Replace with integer boundary crossing: on each tick, compare how
many fragments should have spawned before vs after this tick.
This distributes exactly N fragments across M ticks evenly.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant