v2.1.0: fixed targeted traps firing on dead targets in very rare cases
This commit is contained in:
@@ -55,6 +55,7 @@ public class DisintegrationTrap extends Trap {
|
||||
if (target == null){
|
||||
float closestDist = Float.MAX_VALUE;
|
||||
for (Char ch : Actor.chars()){
|
||||
if (!ch.isAlive()) continue;
|
||||
float curDist = Dungeon.level.trueDistance(pos, ch.pos);
|
||||
if (ch.invisible > 0) curDist += 1000;
|
||||
Ballistica bolt = new Ballistica(pos, ch.pos, Ballistica.PROJECTILE);
|
||||
|
||||
@@ -65,6 +65,7 @@ public class GrimTrap extends Trap {
|
||||
if (target == null){
|
||||
float closestDist = Float.MAX_VALUE;
|
||||
for (Char ch : Actor.chars()){
|
||||
if (!ch.isAlive()) continue;
|
||||
float curDist = Dungeon.level.trueDistance(pos, ch.pos);
|
||||
if (ch.invisible > 0) curDist += 1000;
|
||||
Ballistica bolt = new Ballistica(pos, ch.pos, Ballistica.PROJECTILE);
|
||||
|
||||
@@ -77,6 +77,7 @@ public class PoisonDartTrap extends Trap {
|
||||
if (target == null){
|
||||
float closestDist = Float.MAX_VALUE;
|
||||
for (Char ch : Actor.chars()){
|
||||
if (!ch.isAlive()) continue;
|
||||
float curDist = Dungeon.level.trueDistance(pos, ch.pos);
|
||||
if (ch.invisible > 0) curDist += 1000;
|
||||
Ballistica bolt = new Ballistica(pos, ch.pos, Ballistica.PROJECTILE);
|
||||
|
||||
@@ -62,6 +62,7 @@ public class WornDartTrap extends Trap {
|
||||
if (target == null){
|
||||
float closestDist = Float.MAX_VALUE;
|
||||
for (Char ch : Actor.chars()){
|
||||
if (!ch.isAlive()) continue;
|
||||
float curDist = Dungeon.level.trueDistance(pos, ch.pos);
|
||||
if (ch.invisible > 0) curDist += 1000;
|
||||
Ballistica bolt = new Ballistica(pos, ch.pos, Ballistica.PROJECTILE);
|
||||
|
||||
Reference in New Issue
Block a user