1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-11-10 15:59:53 +00:00

fixed distance calculation in bitruncated {4,4}

This commit is contained in:
Zeno Rogue 2019-12-27 11:30:42 +01:00
parent 432583d6ce
commit e319d953ea

View File

@ -1138,7 +1138,7 @@ EX int dist(int sx, int sy, bool reduce IS(true)) {
int z0 = abs(sx); int z0 = abs(sx);
int z1 = abs(sy); int z1 = abs(sy);
if(a4 && BITRUNCATED) if(a4 && BITRUNCATED)
return (z0 == z1 && z0 > 0 && reduce) ? z0+1: max(z0, z1); return (z0 == z1 && z0 > 0 && !reduce) ? z0+1: max(z0, z1);
if(a4) return z0 + z1; if(a4) return z0 + z1;
int z2 = abs(sx+sy); int z2 = abs(sx+sy);
return max(max(z0,z1), z2); return max(max(z0,z1), z2);