1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-02-09 23:50:08 +00:00

added bucket_scale to fix bucketing problems

This commit is contained in:
Zeno Rogue 2023-05-15 02:31:25 +02:00
parent a70e799081
commit fd3cc72508

View File

@ -1689,8 +1689,10 @@ EX ld raddif(ld a, ld b) {
return d; return d;
} }
EX int bucket_scale = 10000;
EX unsigned bucketer(ld x) { EX unsigned bucketer(ld x) {
return unsigned((long long)(x * 10000 + 100000.5) - 100000); return (unsigned) (long long) (floor(x * bucket_scale));
} }
EX unsigned bucketer(hyperpoint h) { EX unsigned bucketer(hyperpoint h) {