v2.2.0: fixed tengu rarely throwing two bombs at the same tile

This commit is contained in:
Evan Debenham
2023-09-15 13:45:50 -04:00
parent 5e59891249
commit d650f9b720

View File

@@ -556,10 +556,16 @@ public class Tengu extends Mob {
int targetCell = -1;
//Targets closest cell which is adjacent to target
//Targets closest cell which is adjacent to target and has no existing bombs
for (int i : PathFinder.NEIGHBOURS8){
int cell = target.pos + i;
if (!Dungeon.level.solid[cell] &&
boolean bombHere = false;
for (BombAbility b : thrower.buffs(BombAbility.class)){
if (b.bombPos == cell){
bombHere = true;
}
}
if (!bombHere && !Dungeon.level.solid[cell] &&
(targetCell == -1 || Dungeon.level.trueDistance(cell, thrower.pos) < Dungeon.level.trueDistance(targetCell, thrower.pos))){
targetCell = cell;
}