v0.8.2c: fixed non-enemy mobs triggering swarm intelligence

This commit is contained in:
Evan Debenham 2020-08-24 17:17:43 -04:00
parent 076b26302c
commit e1f202b635

View File

@ -771,7 +771,7 @@ public abstract class Mob extends Char {
state = HUNTING;
target = enemy.pos;
if (Dungeon.isChallenged( Challenges.SWARM_INTELLIGENCE )) {
if (alignment == Alignment.ENEMY && Dungeon.isChallenged( Challenges.SWARM_INTELLIGENCE )) {
for (Mob mob : Dungeon.level.mobs) {
if (Dungeon.level.distance(pos, mob.pos) <= 8 && mob.state != mob.HUNTING) {
mob.beckon( target );
@ -817,7 +817,7 @@ public abstract class Mob extends Char {
state = HUNTING;
target = enemy.pos;
if (Dungeon.isChallenged( Challenges.SWARM_INTELLIGENCE )) {
if (alignment == Alignment.ENEMY && Dungeon.isChallenged( Challenges.SWARM_INTELLIGENCE )) {
for (Mob mob : Dungeon.level.mobs) {
if (Dungeon.level.distance(pos, mob.pos) <= 8 && mob.state != mob.HUNTING) {
mob.beckon( target );