v3.0.0: adjusted mob aggroing behaviour when they are hit by target
This commit is contained in:
@@ -703,7 +703,8 @@ public abstract class Mob extends Char {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//if attacked by something else than current target, and that thing is closer, switch targets
|
//if attacked by something else than current target, and that thing is closer, switch targets
|
||||||
if (this.enemy == null
|
//or if attacked by target, simply update target position
|
||||||
|
if (this.enemy == null || enemy == this.enemy
|
||||||
|| (enemy != this.enemy && (Dungeon.level.distance(pos, enemy.pos) < Dungeon.level.distance(pos, this.enemy.pos)))) {
|
|| (enemy != this.enemy && (Dungeon.level.distance(pos, enemy.pos) < Dungeon.level.distance(pos, this.enemy.pos)))) {
|
||||||
aggro(enemy);
|
aggro(enemy);
|
||||||
target = enemy.pos;
|
target = enemy.pos;
|
||||||
|
|||||||
Reference in New Issue
Block a user