1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-06-14 09:26:52 +00:00

added epsilon to virtualRebase to prevent infinite loops caused by precision errors

This commit is contained in:
? 2019-02-27 13:33:05 +01:00 committed by Zeno Rogue
parent 168b3fb11d
commit 2b307f5e4a

View File

@ -343,7 +343,7 @@ void virtualRebase(cell*& base, T& at, bool tohex, const U& check) {
forCellCM(c2, base) {
transmatrix V2 = calc_relative_matrix(base, c2, C0);
double newz = check(V2 * at) [DIM];
if(newz < currz) {
if(newz < currz - 1e-4) {
currz = newz;
bestV = V2;
newbase = c2;