mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-01-11 18:00:34 +00:00
addstep, protected cw+wstep
This commit is contained in:
parent
8b5c0bbe70
commit
49e92f4288
@ -123,6 +123,12 @@ EX void ufindc(tcell*& c) {
|
|||||||
|
|
||||||
EX tcell *first_tcell = nullptr;
|
EX tcell *first_tcell = nullptr;
|
||||||
|
|
||||||
|
twalker addstep(twalker x) {
|
||||||
|
x.cpeek();
|
||||||
|
ufind(x);
|
||||||
|
return x + wstep;
|
||||||
|
}
|
||||||
|
|
||||||
void connect_and_check(twalker p1, twalker p2);
|
void connect_and_check(twalker p1, twalker p2);
|
||||||
void unify(twalker pw1, twalker pw2);
|
void unify(twalker pw1, twalker pw2);
|
||||||
|
|
||||||
@ -771,7 +777,7 @@ void treewalk(twalker& cw, int delta) {
|
|||||||
int d = get_parent_dir(cw.at);
|
int d = get_parent_dir(cw.at);
|
||||||
if(cw.spin == d) cw += wstep;
|
if(cw.spin == d) cw += wstep;
|
||||||
else {
|
else {
|
||||||
auto cw1 = cw+wstep;
|
auto cw1 = addstep(cw);
|
||||||
get_parent_dir(cw1.at);
|
get_parent_dir(cw1.at);
|
||||||
ufind(cw1);
|
ufind(cw1);
|
||||||
if(get_parent_dir(cw1.at) == cw1.spin) cw += wstep;
|
if(get_parent_dir(cw1.at) == cw1.spin) cw += wstep;
|
||||||
|
Loading…
Reference in New Issue
Block a user