1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-12-20 15:40:26 +00:00

addstep, protected cw+wstep

This commit is contained in:
Zeno Rogue 2021-08-19 01:27:26 +02:00
parent 8b5c0bbe70
commit 49e92f4288

View File

@ -123,6 +123,12 @@ EX void ufindc(tcell*& c) {
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 unify(twalker pw1, twalker pw2);
@ -771,7 +777,7 @@ void treewalk(twalker& cw, int delta) {
int d = get_parent_dir(cw.at);
if(cw.spin == d) cw += wstep;
else {
auto cw1 = cw+wstep;
auto cw1 = addstep(cw);
get_parent_dir(cw1.at);
ufind(cw1);
if(get_parent_dir(cw1.at) == cw1.spin) cw += wstep;