L2JMobius
Public Development => Solved/Invalid Bug Reports => Topic started by: kamikadzz on March 25, 2022, 04:55:44 PM
-
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:
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.
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
-
Hi i found strange this line of code:
minion.setLeader(null); // prevent memory leaks
Did you add it? Why im asking, because in the first we see this line:
final Monster leader = ((Monster) npc).getLeader();
this code:
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 :)
// minion.setLeader(null); // prevent memory leaks