mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-01-01 21:10:35 +00:00
fixed a bug causing skipped branches to interact badly with single live branches
This commit is contained in:
parent
61c5ad9344
commit
d7d3d21d2a
15
rulegen.cpp
15
rulegen.cpp
@ -1565,6 +1565,10 @@ void verified_treewalk(twalker& tw, int id, int dir) {
|
|||||||
treewalk(tw, dir);
|
treewalk(tw, dir);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
vector<reaction_t> skipped_branches;
|
||||||
|
using branch_check = tuple<int, int, int>;
|
||||||
|
set<branch_check> checks_to_skip;
|
||||||
|
|
||||||
bool examine_branch(int id, int left, int right) {
|
bool examine_branch(int id, int left, int right) {
|
||||||
auto rg = treestates[id].giver;
|
auto rg = treestates[id].giver;
|
||||||
|
|
||||||
@ -1585,7 +1589,11 @@ bool examine_branch(int id, int left, int right) {
|
|||||||
steps++;
|
steps++;
|
||||||
if(steps > max_examine_branch) {
|
if(steps > max_examine_branch) {
|
||||||
debuglist = { rg+left, wl, wr };
|
debuglist = { rg+left, wl, wr };
|
||||||
if(branch_conflicts_seen.size())
|
if(skipped_branches.size()) {
|
||||||
|
checks_to_skip.clear();
|
||||||
|
throw rulegen_retry("max_examine_branch exceeded after a skipped check");
|
||||||
|
}
|
||||||
|
else if(branch_conflicts_seen.size())
|
||||||
/* may be not a real problem, but caused by incorrect detection of live branches */
|
/* may be not a real problem, but caused by incorrect detection of live branches */
|
||||||
throw rulegen_retry("max_examine_branch exceeded after a conflict");
|
throw rulegen_retry("max_examine_branch exceeded after a conflict");
|
||||||
else
|
else
|
||||||
@ -1693,9 +1701,6 @@ EX void clean_analyzers() {
|
|||||||
next_analyzer_id = 0;
|
next_analyzer_id = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
using branch_check = tuple<int, int, int>;
|
|
||||||
set<branch_check> checks_to_skip;
|
|
||||||
|
|
||||||
EX void clean_data() {
|
EX void clean_data() {
|
||||||
clean_analyzers();
|
clean_analyzers();
|
||||||
checks_to_skip.clear();
|
checks_to_skip.clear();
|
||||||
@ -1818,7 +1823,7 @@ EX void rules_iteration() {
|
|||||||
|
|
||||||
handle_queued_extensions();
|
handle_queued_extensions();
|
||||||
|
|
||||||
vector<reaction_t> skipped_branches;
|
skipped_branches.clear();
|
||||||
|
|
||||||
auto examine_or_skip_branch = [&] (int id, int fb, int sb) {
|
auto examine_or_skip_branch = [&] (int id, int fb, int sb) {
|
||||||
auto b = branch_check{treestates[id].astate, fb, sb};
|
auto b = branch_check{treestates[id].astate, fb, sb};
|
||||||
|
Loading…
Reference in New Issue
Block a user