v0.9.1b: fixed further errors with DM-300 pathfinding
This commit is contained in:
parent
50ec4f8dbe
commit
3e1c4f6e9e
|
@ -264,7 +264,7 @@ public class NewDM300 extends Mob {
|
||||||
chargeAnnounced = true;
|
chargeAnnounced = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (state == WANDERING && Dungeon.hero.invisible <= 0){
|
if (Dungeon.hero.invisible <= 0){
|
||||||
beckon(Dungeon.hero.pos);
|
beckon(Dungeon.hero.pos);
|
||||||
state = HUNTING;
|
state = HUNTING;
|
||||||
enemy = Dungeon.hero;
|
enemy = Dungeon.hero;
|
||||||
|
@ -514,26 +514,11 @@ public class NewDM300 extends Mob {
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
if (!supercharged || rooted || target == pos) {
|
if (!supercharged || rooted || target == pos || Dungeon.level.adjacent(pos, target)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
int bestpos = pos;
|
int bestpos = pos;
|
||||||
for (int i : PathFinder.NEIGHBOURS8){
|
|
||||||
if (Dungeon.level.openSpace[pos+i] && Actor.findChar(pos+i) == null &&
|
|
||||||
Dungeon.level.distance(bestpos, target) > Dungeon.level.distance(pos+i, target)){
|
|
||||||
bestpos = pos+i;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (bestpos != pos){
|
|
||||||
move( bestpos );
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (state != HUNTING || Dungeon.level.adjacent(pos, target)){
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (int i : PathFinder.NEIGHBOURS8){
|
for (int i : PathFinder.NEIGHBOURS8){
|
||||||
if (Actor.findChar(pos+i) == null &&
|
if (Actor.findChar(pos+i) == null &&
|
||||||
Dungeon.level.trueDistance(bestpos, target) > Dungeon.level.trueDistance(pos+i, target)){
|
Dungeon.level.trueDistance(bestpos, target) > Dungeon.level.trueDistance(pos+i, target)){
|
||||||
|
|
Loading…
Reference in New Issue
Block a user