L2JMobius

C6 Guards keep attacking monsters

G-hamsteR · 3 · 6048

Online G-hamsteR

  • Viscount
  • *****
    • Posts: 328
Hello,

Even if you change the following config, guards keep hitting monsters with agro.

Code: [Select]
# If you wish to disable the use of guards against aggressive monsters.
# Default is False.
AllowGuards = False



Online G-hamsteR

  • Viscount
  • *****
    • Posts: 328
This fixed the problem:

Code: [Select]
diff --git java/org/l2jmobius/gameserver/model/actor/knownlist/GuardKnownList.java java/org/l2jmobius/gameserver/model/actor/knownlist/GuardKnownList.java
index d56cc8e..e5ef687 100644
--- java/org/l2jmobius/gameserver/model/actor/knownlist/GuardKnownList.java
+++ java/org/l2jmobius/gameserver/model/actor/knownlist/GuardKnownList.java
@@ -41,6 +40,10 @@
  @Override
  public boolean addKnownObject(WorldObject object, Creature dropper)
  {
+ if (!Config.ALLOW_GUARDS && (object instanceof MonsterInstance))
+ {
+ return false;
+ }
  if (!super.addKnownObject(object, dropper))
  {
  return false;
  return true;
  }