mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-01-20 06:03:01 +00:00
rulegen::clear analyzers on doubling
This commit is contained in:
parent
137763dae9
commit
1798bc4612
39
rulegen.cpp
39
rulegen.cpp
@ -1277,7 +1277,19 @@ void find_single_live_branch(twalker at) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void rules_iteration() {
|
EX void rules_iteration() {
|
||||||
|
try_count++;
|
||||||
|
|
||||||
|
if((try_count & (try_count-1)) == 0) {
|
||||||
|
analyzers.clear();
|
||||||
|
important = t_origin;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(debugflags & DF_GEOM) println(hlog, "attempt: ", try_count);
|
||||||
|
|
||||||
|
auto c = first_tcell;
|
||||||
|
while(c) { c->code = MYSTERY; c = c->next; }
|
||||||
|
|
||||||
clear_codes();
|
clear_codes();
|
||||||
|
|
||||||
cq = important;
|
cq = important;
|
||||||
@ -1443,24 +1455,15 @@ EX void generate_rules() {
|
|||||||
|
|
||||||
important = t_origin;
|
important = t_origin;
|
||||||
|
|
||||||
retry:
|
while(true) {
|
||||||
try {
|
try {
|
||||||
rules_iteration();
|
rules_iteration();
|
||||||
}
|
break;
|
||||||
catch(rulegen_retry& e) {
|
|
||||||
try_count++;
|
|
||||||
if(try_count >= max_retries)
|
|
||||||
throw;
|
|
||||||
if(debugflags & DF_GEOM) println(hlog, "attempt: ", try_count);
|
|
||||||
auto c = first_tcell;
|
|
||||||
while(c) {
|
|
||||||
c->is_solid = false;
|
|
||||||
c->parent_dir = MYSTERY;
|
|
||||||
c->code = MYSTERY;
|
|
||||||
c = c->next;
|
|
||||||
}
|
}
|
||||||
goto retry;
|
catch(rulegen_retry& e) {
|
||||||
}
|
if(try_count >= max_retries) throw;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int reclevel;
|
int reclevel;
|
||||||
|
Loading…
Reference in New Issue
Block a user