mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-09-12 15:26:00 +00:00
fixed some distlimit bugs
This commit is contained in:
20
cell.cpp
20
cell.cpp
@@ -1744,7 +1744,7 @@ EX bool is_boundary(cell *c) {
|
||||
}
|
||||
|
||||
/** compute the distlimit for a tessellation automatically */
|
||||
EX int auto_compute_range(cell *c) {
|
||||
EX int auto_compute_range(cell *c) {
|
||||
if(sphere) {
|
||||
cgi.base_distlimit = SEE_ALL;
|
||||
return SEE_ALL;
|
||||
@@ -1764,6 +1764,24 @@ EX int auto_compute_range(cell *c) {
|
||||
return ginf[geometry].distlimit[0] = cgi.base_distlimit = d;
|
||||
}
|
||||
|
||||
EX int getDistLimit() {
|
||||
auto& res = cgi.base_distlimit;
|
||||
if(res) return res;
|
||||
if(arb::in() && arb::current.range)
|
||||
return res = arb::current.range;
|
||||
if(arcm::in() || arb::in()) {
|
||||
if(!currentmap) return 0;
|
||||
cell *c = currentmap->gamestart();
|
||||
if(!c) return 0;
|
||||
return res = auto_compute_range(c);
|
||||
}
|
||||
if(mhybrid)
|
||||
return res = hybrid::in_underlying_geometry([&] {
|
||||
return max(getDistLimit()-1, 0);
|
||||
});
|
||||
return ginf[geometry].distlimit[!BITRUNCATED];
|
||||
}
|
||||
|
||||
EX cell out_of_bounds;
|
||||
EX heptagon oob;
|
||||
|
||||
|
Reference in New Issue
Block a user