From 83e69a4872a2c583090e877e636208c1fd068744 Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Wed, 25 Aug 2021 12:56:56 +0200 Subject: [PATCH] rulegen:: addstep used in one more place --- rulegen.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/rulegen.cpp b/rulegen.cpp index 068b5299..0389d6f9 100644 --- a/rulegen.cpp +++ b/rulegen.cpp @@ -152,6 +152,7 @@ EX void ufindc(tcell*& c) { EX tcell *first_tcell = nullptr; +// sometimes the standard x+wstep returns nullptr because of unification twalker addstep(twalker x) { x.cpeek(); ufind(x); @@ -872,12 +873,12 @@ EX set single_live_branch_close_to_root; void treewalk(twalker& cw, int delta) { int d = get_parent_dir(cw.at); - if(cw.spin == d) cw += wstep; + if(cw.spin == d) cw = addstep(cw); else { auto cw1 = addstep(cw); get_parent_dir(cw1.at); ufind(cw1); - if(get_parent_dir(cw1.at) == cw1.spin) cw += wstep; + if(get_parent_dir(cw1.at) == cw1.spin) cw = cw1; } cw+=delta; }