1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-12-24 17:10:36 +00:00

no destroyTraps if makeflame checkonly; monster pathfinding takes OoL into account

This commit is contained in:
Zeno Rogue 2017-10-14 19:18:02 +02:00
parent eda08be74a
commit c6a63f121e

View File

@ -1595,7 +1595,7 @@ bool snakepile(cell *c, eMonster m) {
} }
bool makeflame(cell *c, int timeout, bool checkonly) { bool makeflame(cell *c, int timeout, bool checkonly) {
destroyTrapsOn(c); if(!checkonly) destroyTrapsOn(c);
if(itemBurns(c->item)) { if(itemBurns(c->item)) {
if(checkonly) return true; if(checkonly) return true;
addMessage(XLAT("%The1 burns!", c->item)), c->item = itNone; addMessage(XLAT("%The1 burns!", c->item)), c->item = itNone;
@ -2605,18 +2605,21 @@ void computePathdist(eMonster param) {
for(int j=0; j<c->type; j++) { for(int j=0; j<c->type; j++) {
int i = (fd+j) % c->type; int i = (fd+j) % c->type;
// printf("i=%d cd=%d\n", i, c->mov[i]->cpdist); // printf("i=%d cd=%d\n", i, c->mov[i]->cpdist);
cell *c2 = c->mov[i];
if(c->mov[i] && c->mov[i]->pathdist == PINFD && if(c2 && c2->pathdist == PINFD &&
passable(c->mov[i], (qb<qtarg) && !nonAdjacent(c,c->mov[i]) && !thruVine(c,c->mov[i]) ?NULL:c, P_MONSTER | P_REVDIR)) { passable(c2, (qb<qtarg) && !nonAdjacent(c,c2) && !thruVine(c,c2) ?NULL:c, P_MONSTER | P_REVDIR)) {
if(qb >= qtarg) { if(qb >= qtarg) {
if(param == moTortoise && nogoSlow(c, c->mov[i])) continue; if(param == moTortoise && nogoSlow(c, c2)) continue;
if(param == moIvyRoot && strictlyAgainstGravity(c, c->mov[i], false, MF_IVY)) continue; if(param == moIvyRoot && strictlyAgainstGravity(c, c2, false, MF_IVY)) continue;
if(param == moWorm && (cellUnstable(c) || cellEdgeUnstable(c))) continue; if(param == moWorm && (cellUnstable(c) || cellEdgeUnstable(c))) continue;
if(items[itOrbLava] && c2->cpdist <= 5 && pseudohept(c) && makeflame(c2, 1, true))
continue;
} }
c->mov[i]->pathdist = d+1; c2->pathdist = d+1;
pathq.push_back(c->mov[i]); reachedfrom.push_back(c->spn(i)); pathq.push_back(c2); reachedfrom.push_back(c->spn(i));
} }
} }
} }