From a8a75fd0cabcb637c290d00f4f69f7789ae6f6c1 Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Fri, 17 Apr 2026 17:42:11 +0200 Subject: [PATCH] fixed Vine Spirits sometimes considering some halfvine-related moves illegal --- celldrawer.cpp | 4 +--- flags.cpp | 5 +++++ passable.cpp | 15 +++------------ 3 files changed, 9 insertions(+), 15 deletions(-) diff --git a/celldrawer.cpp b/celldrawer.cpp index 2f01f31e..d750ecef 100644 --- a/celldrawer.cpp +++ b/celldrawer.cpp @@ -987,9 +987,7 @@ void celldrawer::draw_grid_edge(int t, color_t col, int prec) { void celldrawer::draw_halfvine() { - int i =-1; - for(int t=0;t<6; t++) if(c->move(t) && c->move(t)->wall == c->wall) - i = t; + int i = halfvine_direction(c); qfi.spin = ddspin(c, i, M_PI/S3); shiftmatrix V2 = V * qfi.spin; diff --git a/flags.cpp b/flags.cpp index 98ec40ba..87f8b60c 100644 --- a/flags.cpp +++ b/flags.cpp @@ -413,4 +413,9 @@ EX bool looks_like_player(eMonster m) { return among(m, moPlayer, moMimic, moIllusion, moShadow); } +EX int halfvine_direction(cell *c) { + for(int t=0; ttype; t++) if(c->move(t) && c->move(t)->wall == c->wall) return t; + return -1; + } + } diff --git a/passable.cpp b/passable.cpp index a00c1631..662d4ea5 100644 --- a/passable.cpp +++ b/passable.cpp @@ -382,22 +382,13 @@ bool slimepassable(cell *w, cell *c) { // only travel to halfvines correctly if(cellHalfvine(c)) { - int i=0; - for(int t=0; ttype; t++) if(c->move(t) && c->move(t)->wall == c->wall) i=t; - int z = i-u; if(z<0) z=-z; z%=6; - if(z>1) return false; - hv=(group == ogroup); + if(angledist(c, halfvine_direction(c), u) > 1) return false; } // only travel from halfvines correctly if(cellHalfvine(w)) { - int i=0; - for(int t=0; ttype; t++) if(w->move(t) && w->move(t)->wall == w->wall) i=t; - int z = i-c->c.spin(u); if(z<0) z=-z; z%=6; - if(z>1) return false; - hv=(group == ogroup); + if(angledist(w, halfvine_direction(w), c->c.spin(u)) > 1) return false; } - if(!hv) return false; - return true; + return hv; } bool sharkpassable(cell *w, cell *c) {