Skip to content

Fix an infinite loop that appears randomly in HXT

Ranger Wesley requested to merge fix_hxt_infinite_loop into master

In "hxt_tetOpti.c", there is a division operation to compute conflictRatio. However, "stat.attempt" sometimes can be zero, then the expression will be undefined.

In this case, (conflictRatio == 0.0) is always false and the code would never reach the "break" line, and the loop will run forever.

This commit fixes the issue by setting conflictRatio to zero as long as stat.attempt is zero.

Merge request reports