From fd67768234e60662442703f27c09888ecbfff7be Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Thu, 26 Sep 2019 13:13:44 +0200 Subject: [PATCH] reverse_directions for heptagons --- game.cpp | 9 +++++++++ locations.cpp | 3 --- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/game.cpp b/game.cpp index 315d6a21..467d09dc 100644 --- a/game.cpp +++ b/game.cpp @@ -4278,6 +4278,15 @@ EX int pickDownDirection(cell *c, flagtype mf) { } EX vector reverse_directions(cell *c, int dir) { + if(PURE) return reverse_directions(c->master, dir); + int d = c->degree(); + if(d & 1) + return { gmod(dir + c->type/2, c->type), gmod(dir + (c->type+1)/2, c->type) }; + else + return { gmod(dir + c->type/2, c->type) }; + } + +EX vector reverse_directions(heptagon *c, int dir) { int d = c->degree(); switch(geometry) { case gBinary3: diff --git a/locations.cpp b/locations.cpp index b54c07ca..4fcd634f 100644 --- a/locations.cpp +++ b/locations.cpp @@ -204,9 +204,6 @@ static const struct revstep_t { revstep_t() {}} revstep; extern int hrand(int); -/** reverse directions are currently not implemented for heptagons */ -inline vector reverse_directions(struct heptagon *c, int i) { throw "unimplemented"; } - /** the walker structure is used for walking on surfaces defined via \ref connection_table. */ template struct walker { /** where we are at */