Fix division by zero possibility during frame matching.

This commit is contained in:
Dario 2024-05-18 21:25:51 -03:00
parent df5bd0cfd1
commit b2e98b9d28

View File

@ -646,9 +646,14 @@ namespace RT64 {
}
auto modulo = [](int a, int b) {
int r = a % b;
return r < 0 ? r + b : r;
};
if (b != 0) {
int r = a % b;
return r < 0 ? r + b : r;
}
else {
return 0;
}
};
const float deltaUls = curTile.uls - prevTile.uls;
const float deltaUlt = curTile.ult - prevTile.ult;