Closed fr1nge closed 12 years ago
I can confirm this crash, but AttackerStateUpdate already has a check against dead targets.
if (!pVictim->isAlive())
return;
... or am I missing something?
EDIT: Nvm misread your comment, idk why it fails to check but doesnt crashes with the fix I linked anymore, so it has smth to do with it.
Hmm, I think we should remove the DoMeleeAttacksIfReady function from the boss script at all.
However there might be a possible problem: The problem (in MaNGOS - bool Unit::UpdateMeleeAttackingState() ) could be that: If the enemy is killed, getVictim is set to NULL (not sure here). This would then crash on the offhand swing.
possible solutions: 1) add a getVictim() check 2) use an "else" to prevent doing main and offhand attack in one tick (but this is kind of random solution..)
Can the Trash ability be implemented in some other way if DoMeleeAttacksIfReady() is removed? (I guess that's what this function is for)
This function is from old times when mangos did not support npc-offhand attack. But this has changed by now. So provided the weapon is set proper, there should no additional code be required for offhand attack.
Any updates on this on how is the best way to handle it?
This boss will be updated on SD2 master, and probably there will be some changes. I'll let you know when this is done so you can retest.
Fixed in [s2609].
Function DoMeleeAttacksIfReady() doesn't have required target checks. If main-hand attack kills the player then the off-hand attack tries to do damage to a dead target, for some reason it's not properly handled by m_creature->AttackerStateUpdate() and it crashes the server.
Method to reproduce: One player tanks, the other dpses, once it gets to phase 2 tank should die, boss goes for squishy player, one-shots him and server crashes.