v0.3.0b: fixed a crash issue with corruption and certain mobs
This commit is contained in:
parent
454d49f49b
commit
0efb22db42
|
@ -60,7 +60,8 @@ public class Piranha extends Mob {
|
|||
//this causes pirahna to move away when a door is closed on them.
|
||||
Dungeon.level.updateFieldOfView( this );
|
||||
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;
|
||||
int oldPos = pos;
|
||||
int i = 0;
|
||||
|
|
|
@ -499,7 +499,7 @@ public class Ghost extends NPC {
|
|||
@Override
|
||||
protected boolean getCloser( int target ) {
|
||||
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 );
|
||||
} else {
|
||||
return super.getCloser( target );
|
||||
|
|
Loading…
Reference in New Issue
Block a user