1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-11-27 14:37:16 +00:00

walker now automatically fixes spin

This commit is contained in:
Zeno Rogue 2019-08-09 14:38:55 +02:00
parent 661743a19b
commit b57c4c8d4e

View File

@ -635,7 +635,7 @@ template<class T> struct walker {
T *at;
int spin;
bool mirrored;
walker<T> (T *at = NULL, int s = 0, bool m = false) : at(at), spin(s), mirrored(m) { }
walker<T> (T *at = NULL, int s = 0, bool m = false) : at(at), spin(s), mirrored(m) { if(at) s = at->c.fix(s); }
walker<T>& operator += (int i) {
spin = at->c.fix(spin+(mirrored?-i:i));
return (*this);