1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-09-03 11:17:56 +00:00

fixed the direction setup by Orb of Chaos

This commit is contained in:
Zeno Rogue
2021-06-16 11:02:02 +02:00
parent 56556ca1e1
commit 7b38fc4de1
2 changed files with 17 additions and 8 deletions

View File

@@ -259,6 +259,11 @@ template<class T> struct walker {
bool operator < (const walker<T>& cw2) const {
return tie(at, spin, mirrored) < tie(cw2.at, cw2.spin, cw2.mirrored);
}
/** how much should we spin to face direction dir */
int to_spin(int dir) {
return gmod(dir - spin, at->type) * (mirrored ? -1 : 1);
}
walker<T>& operator ++ (int) { return (*this) += 1; }
walker<T>& operator -- (int) { return (*this) -= 1; }