1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-11-20 03:54:47 +00:00

rulegen:: handle dead roots

This commit is contained in:
Zeno Rogue 2021-08-23 15:50:08 +02:00
parent 308ed5cbb1
commit 711ae44605

View File

@ -1536,6 +1536,15 @@ EX void rules_iteration() {
branch_conflicts_seen.clear();
// handle dead roots -- some of their branches MUST live
for(int id=0; id<isize(treestates); id++) if(treestates[id].is_root && !treestates[id].is_live) {
auto r = treestates[id].rules;
for(int i=0; i<isize(r); i++) if(r[i] >= 0) {
examine_branch(id, i, i);
break;
}
}
for(int id=0; id<isize(treestates); id++) if(treestates[id].is_live) {
auto r = treestates[id].rules; /* no & because treestates might have moved */
if(r.empty()) continue;