v0.3.0b: fixed a crash issue with corruption and certain mobs

This commit is contained in:
Evan Debenham 2015-05-28 13:54:06 -04:00 committed by Evan Debenham
parent 454d49f49b
commit 0efb22db42
2 changed files with 3 additions and 2 deletions

View File

@ -60,7 +60,8 @@ public class Piranha extends Mob {
//this causes pirahna to move away when a door is closed on them. //this causes pirahna to move away when a door is closed on them.
Dungeon.level.updateFieldOfView( this ); Dungeon.level.updateFieldOfView( this );
enemy = chooseEnemy(); enemy = chooseEnemy();
if (state == this.HUNTING && !(enemy.isAlive() && Level.fieldOfView[enemy.pos] && enemy.invisible <= 0)){ if (state == this.HUNTING &&
!(enemy != null && enemy.isAlive() && Level.fieldOfView[enemy.pos] && enemy.invisible <= 0)){
state = this.WANDERING; state = this.WANDERING;
int oldPos = pos; int oldPos = pos;
int i = 0; int i = 0;

View File

@ -499,7 +499,7 @@ public class Ghost extends NPC {
@Override @Override
protected boolean getCloser( int target ) { protected boolean getCloser( int target ) {
combo = 0; //if he's moving, he isn't attacking, reset combo. combo = 0; //if he's moving, he isn't attacking, reset combo.
if (Level.adjacent(pos, enemy.pos)) { if (enemy != null && Level.adjacent(pos, enemy.pos)) {
return getFurther( target ); return getFurther( target );
} else { } else {
return super.getCloser( target ); return super.getCloser( target );