1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-11-23 21:07:17 +00:00

fixed pushing in shmup

This commit is contained in:
Zeno Rogue 2020-03-08 00:02:00 +01:00
parent 2dca5c2d43
commit e6b5a333ba

View File

@ -1069,7 +1069,7 @@ void movePlayer(monster *m, int delta) {
} }
} }
else if(isPushable(c2->wall) && !nonAdjacent(c2, m->base)) { else if(isPushable(c2->wall) && !nonAdjacent(c2, m->base)) {
int sd1 = neighborId(m->base, c2); int sd1 = neighborId(c2, m->base);
int sd = m->base->c.spin(sd1); int sd = m->base->c.spin(sd1);
int subdir = 1; int subdir = 1;
double bestd = 9999; double bestd = 9999;
@ -1081,7 +1081,7 @@ void movePlayer(monster *m, int delta) {
if(d<bestd) bestd=d, subdir = di; if(d<bestd) bestd=d, subdir = di;
} }
pushmonsters(); pushmonsters();
auto mip = determinePush(cellwalker(c2, sd1), subdir, [m, c2] (cell *c) { return canPushThumperOn(c, c2, m->base); }); auto mip = determinePush(cellwalker(c2, sd1)+wstep, subdir, [m, c2] (cell *c) { return canPushThumperOn(c, c2, m->base); });
visibleFor(300); visibleFor(300);
if(!mip.proper()) go = false; if(!mip.proper()) go = false;
else pushThumper(mip); else pushThumper(mip);