mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2026-05-08 00:01:24 +00:00
fixed Vine Spirits sometimes considering some halfvine-related moves illegal
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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; t<c->type; t++) if(c->move(t) && c->move(t)->wall == c->wall) return t;
|
||||
return -1;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
15
passable.cpp
15
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; t<c->type; 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; t<w->type; 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) {
|
||||
|
||||
Reference in New Issue
Block a user