L2JMobius

Free Users => Shares/Contributions => Committed User Contributions => Topic started by: G-hamsteR on September 16, 2020, 07:35:28 AM

Title: Guards keep attacking monsters
Post by: G-hamsteR on September 16, 2020, 07:35:28 AM
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

Title: Re: Guards keep attacking monsters
Post by: G-hamsteR on September 16, 2020, 08:18:49 AM
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;
  }
 
Title: Re: Guards keep attacking monsters
Post by: Mobius on September 16, 2020, 03:19:26 PM
Committed with https://bitbucket.org/MobiusDev/l2j_mobius/commits/91c5c63ac853ffcf155515feee3f319c4cd96c65
Thanks :D