v0.3.3b: fixed crashes with mobs fleeing, further tweaked thief behaviour

This commit is contained in:
Evan Debenham 2015-12-25 17:22:38 -05:00
parent e03988defe
commit 6d3bce93e2
2 changed files with 3 additions and 2 deletions

View File

@ -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;

View File

@ -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;