From 73d9302be5870b3968845667c74726326895b73a Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Fri, 25 Dec 2015 02:29:11 -0500 Subject: [PATCH] v0.3.3a: tweaked fleeing to behave a bit more consistently with an invisible enemy --- .../shatteredpixeldungeon/actors/mobs/Mob.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Mob.java b/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Mob.java index dce4966e0..6089d6b9e 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Mob.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Mob.java @@ -641,11 +641,11 @@ public abstract class Mob extends Char { @Override public boolean act( boolean enemyInFOV, boolean justAlerted ) { enemySeen = enemyInFOV; - if (enemyInFOV) { - target = enemy.pos; //loses target when 0-dist rolls a 6 or greater. - } else if (1 + Random.Int(Level.distance(pos, target)) >= 6){ + if (!enemyInFOV && 1 + Random.Int(Level.distance(pos, target)) >= 6){ target = -1; + } else { + target = enemy.pos; } int oldPos = pos;