1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-06-18 11:19:59 +00:00

arb:: fixed a bug with 'ended at wrong edge determining vertex_valence'

This commit is contained in:
Zeno Rogue 2021-08-04 18:00:34 +02:00
parent e175f522dc
commit 6999277715

View File

@ -300,6 +300,7 @@ EX void compute_vertex_valence() {
for(auto& sh: ac.shapes)
sh.cycle_length = isize(sh.vertices);
recompute:
while(true) {
for(auto& sh: ac.shapes) {
@ -361,7 +362,10 @@ EX void compute_vertex_valence() {
while(total < 360*degree - 1e-6);
if(total > 360*degree + 1e-6) throw hr_parse_exception("improper total in compute_stats");
if(at.sid != i) throw hr_parse_exception("ended at wrong type determining vertex_valence");
if((at.eid - k) % ac.shapes[i].cycle_length) throw hr_parse_exception("ended at wrong edge determining vertex_valence");
if((at.eid - k) % ac.shapes[i].cycle_length) {
ac.shapes[i].cycle_length = abs(gcd(ac.shapes[i].cycle_length, at.eid - k));
goto recompute;
}
sh.vertex_valence[k] = qty;
}
if(debugflags & DF_GEOM)