removed some more incorrect instances of pathdist

This commit is contained in:
Zeno Rogue 2018-06-28 11:55:59 +02:00
parent c6412511f5
commit ed8ff63ce4
3 changed files with 9 additions and 16 deletions

View File

@ -970,15 +970,6 @@ int wallchance(cell *c, bool deepOcean) {
50;
}
bool mouse_reachability_test(cell *c) {
if(c->pathdist != PINFD)
return true;
forCellEx(c2, c)
if(passable(c, c2, 0) && c2->mpdist < c->mpdist)
return mouse_reachability_test(c2);
return false;
}
bool horo_ok() {
// do the horocycles work in the current geometry?
// (they work in ALL hyperbolic geometries currently!)
@ -1139,7 +1130,7 @@ void buildBigStuff(cell *c, cell *from) {
createAlternateMap(c, 2, hsA);
if(c->land == laPalace && ctof(c) && !princess::generating && !shmup::on && multi::players == 1 && horo_ok() && !weirdhyperbolic &&
(princess::forceMouse ? mouse_reachability_test(from) :
(princess::forceMouse ? canReachPlayer(from, moMouse) :
(hrand(2000) < (peace::on ? 100 : 20))) &&
!c->master->alt &&
(princess::challenge || kills[moVizier] || peace::on) && !tactic::on && !yendor::on) {

View File

@ -383,7 +383,7 @@ void giantLandSwitch(cell *c, int d, cell *from) {
c->monst = moVizier;
c->hitpoints = palaceHP();
}
else if(princess::forceVizier && from->pathdist != PINFD) {
else if(princess::forceVizier && hrand(100) < 10 && canReachPlayer(c, moVizier)) {
c->monst = moVizier;
c->hitpoints = palaceHP();
princess::forceVizier = false;

View File

@ -1180,11 +1180,13 @@ eItem targetRangedOrb(cell *c, orbAction a) {
}
// (4a) colt
if(!shmup::on && items[itRevolver] && c->monst && canAttack(cwt.c, moPlayer, c, c->monst, AF_GUN)
&& c->pathdist <= GUNRANGE && !monstersnearO(a, cwt.c, c, moPlayer, NULL, cwt.c)) {
if(!isCheck(a)) gun_attack(c);
return itRevolver;
}
if(!shmup::on && items[itRevolver] && c->monst && canAttack(cwt.c, moPlayer, c, c->monst, AF_GUN)) {
pathdata pd(moEagle);
if(c->pathdist <= GUNRANGE && !monstersnearO(a, cwt.c, c, moPlayer, NULL, cwt.c)) {
if(!isCheck(a)) gun_attack(c);
return itRevolver;
}
}
// (5) psi blast (non-shmup variant)
if(!shmup::on && items[itOrbPsi] && c->monst && (isDragon(c->monst) || !isWorm(c)) && c->monst != moShadow && c->monst != moKrakenH) {