Prohibit triggering onCreatureSee when regions are inactive.

This commit is contained in:
MobiusDevelopment
2021-06-24 00:21:39 +00:00
parent 00eb8fb2ce
commit 6cb552f3de
22 changed files with 132 additions and 44 deletions

View File

@ -5461,9 +5461,13 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
World.getInstance().forEachVisibleObjectInRange(this, Creature.class, _seenCreatureRange, creature ->
{
if (!creature.isInvisible() && _seenCreatures.add(creature))
if (!creature.isInvisible())
{
EventDispatcher.getInstance().notifyEventAsync(new OnCreatureSee(this, creature), this);
final WorldRegion worldRegion = getWorldRegion();
if ((worldRegion != null) && worldRegion.areNeighborsActive() && _seenCreatures.add(creature))
{
EventDispatcher.getInstance().notifyEventAsync(new OnCreatureSee(this, creature), this);
}
}
});
}