diff --git a/complex2.cpp b/complex2.cpp index 080a5af1..08fe9451 100644 --- a/complex2.cpp +++ b/complex2.cpp @@ -1118,6 +1118,10 @@ EX namespace dice { dd.dir = dir1; return dd; } + + EX bool on(cell *c) { + return among(c->wall, waRichDie, waHappyDie) || among(c->monst, moAnimatedDie, moAngryDie); + } EX void roll(movei mi) { auto &cto = mi.t; diff --git a/game.cpp b/game.cpp index 4b603267..433c7b47 100644 --- a/game.cpp +++ b/game.cpp @@ -413,7 +413,7 @@ EX void pushThumper(const movei& mi) { EX bool canPushThumperOn(movei mi, cell *player) { cell *thumper = mi.s; cell *tgt = mi.t; - if(among(thumper->wall, waRichDie, waHappyDie) && !dice::can_roll(mi)) + if(dice::on(thumper) && !dice::can_roll(mi)) return false; if(tgt->wall == waBoat || tgt->wall == waStrandedBoat) return false; if(isReptile(tgt->wall)) return false; diff --git a/orbs.cpp b/orbs.cpp index 32b63e12..1afcb8ec 100644 --- a/orbs.cpp +++ b/orbs.cpp @@ -1157,7 +1157,7 @@ EX movei blowoff_destination(cell *c, int& di) { if(dtype) for(int e=d; etype; e++) { int di = e % c->type; cell *c2 = c->move(di); - if((c->monst == moAnimatedDie || c->monst == moAngryDie || c->wall == waHappyDie || c->wall == waRichDie) && !dice::can_roll(movei(c, di))) + if(dice::on(c) && !dice::can_roll(movei(c, di))) continue; if(c2 && c2->cpdist > c->cpdist && passable(c2, c, P_BLOW)) return movei(c, c2, di); }