From 6d3bce93e240dd4f06c2ad73c44585a7de41ab16 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Fri, 25 Dec 2015 17:22:38 -0500 Subject: [PATCH] v0.3.3b: fixed crashes with mobs fleeing, further tweaked thief behaviour --- .../shatteredpixel/shatteredpixeldungeon/actors/mobs/Mob.java | 2 +- .../shatteredpixeldungeon/actors/mobs/Thief.java | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Mob.java b/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Mob.java index 6089d6b9e..e911d3028 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Mob.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Mob.java @@ -642,7 +642,7 @@ public abstract class Mob extends Char { public boolean act( boolean enemyInFOV, boolean justAlerted ) { enemySeen = enemyInFOV; //loses target when 0-dist rolls a 6 or greater. - if (!enemyInFOV && 1 + Random.Int(Level.distance(pos, target)) >= 6){ + if (enemy == null || !enemyInFOV && 1 + Random.Int(Level.distance(pos, target)) >= 6){ target = -1; } else { target = enemy.pos; diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Thief.java b/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Thief.java index 851af79a6..a9bd2f523 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Thief.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Thief.java @@ -22,6 +22,7 @@ package com.shatteredpixel.shatteredpixeldungeon.actors.mobs; import com.shatteredpixel.shatteredpixeldungeon.Dungeon; import com.shatteredpixel.shatteredpixeldungeon.actors.Char; +import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Corruption; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Terror; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; import com.shatteredpixel.shatteredpixeldungeon.effects.CellEmitter; @@ -186,7 +187,7 @@ public class Thief extends Mob { private class Fleeing extends Mob.Fleeing { @Override protected void nowhereToRun() { - if (buff( Terror.class ) == null) { + if (buff( Terror.class ) == null && buff( Corruption.class ) == null) { if (enemySeen) { sprite.showStatus(CharSprite.NEGATIVE, TXT_RAGE); state = HUNTING;