L2JMobius

Classic Zaken Issue with ELMOREDEN_LADY and POWER_ANGEL_AMON

kamikadzz · 2 · 4591

Offline kamikadzz

  • Black Sheep
  • Knight
  • ***
    • Posts: 65
So I have been digging this for a day now, and can't seem to figure it out.
I got the potential reason why this is happening (and it will happen on any server where the condition is kill leader to kill master).

The code here:
Code: [Select]
if (CommonUtil.contains(ENERGY_OF_INSOLENCE_MINIONS, npc.getId()))
{
final Monster leader = ((Monster) npc).getLeader();
if ((leader != null) && (leader.getMinionList().getSpawnedMinions().isEmpty()) && !leader.isDead())
{
makeMortal(leader);
}
}

which should check for minion death and remove invul fails to run as leader always equals to null.
This is to the with the on minion die which sets leader to null.

Code: [Select]
public void onMinionDie(Monster minion, int respawnTime)
{
minion.setLeader(null); // prevent memory leaks
_spawnedMinions.remove(minion);

final int time = respawnTime < 0 ? _master.isRaid() ? (int) Config.RAID_MINION_RESPAWN_TIMER : 0 : respawnTime;
if ((time > 0) && !_master.isAlikeDead())
{
_respawnTasks.add(ThreadPool.schedule(new MinionRespawnTask(minion), time));
}
}

If someone has a way to fix it without a dirty hack (as i am lost). anythign i tried i get the leader only if minion is alive, soon as its dead - its null


Offline koa

  • Vassal
  • *
    • Posts: 5
Hi i found strange this line of code:
Code: [Select]
minion.setLeader(null); // prevent memory leaks
Did you add it? Why im asking, because in the first we see this line:
Code: [Select]
final Monster leader = ((Monster) npc).getLeader();

this code:
Code: [Select]
if (CommonUtil.contains(ENERGY_OF_INSOLENCE_MINIONS, npc.getId()))
{
final Monster leader = ((Monster) npc).getLeader();
if ((leader != null) && (leader.getMinionList().getSpawnedMinions().isEmpty()) && !leader.isDead())
{
makeMortal(leader);
}
}
will run after the method onMinionDie ?

if yes then you can try to see what happends if you comment out this line :)
Code: [Select]
// minion.setLeader(null); // prevent memory leaks