Jump to content

New assert


Feanordev

Recommended Posts

I dont think ASSERT in Unit::CanReachWithMeleeAttack is really good idea :P (better to return false)

Cause void CreatureEventAI::DoMeleeAttackIfReady() calls getVictim() directly without any real checks so it can pass null pVictim pretty often imo

After applying latest update it was minutes to get (I know I have lot of custom stuff but I don't think its just cause of my mods as victim calling etc is the same in CreatureAI

http://mangos.pastebin.com/DLkS3845

Link to comment
Share on other sites

if this assert is causing you a crash, than this assert is placed in a good place :)

void CreatureEventAI::UpdateAI(const uint32 diff)
{
   //Check if we are in combat (also updates calls threat update code)
   bool Combat = m_creature->SelectHostileTarget() && m_creature->getVictim();
..
   //Melee Auto-Attack
   if (Combat && m_MeleeEnabled)
       DoMeleeAttackIfReady();

So,this must be safe :)

Edit: I cannot understand your crash-log: - No sign of UpdateAI ..

#4 0x00000000008983c7 in CreatureEventAI::DoMeleeAttackIfReady (

this=0x7f0baa5a5b70) at ../../../src/game/CreatureEventAI.cpp:1436

No locals.

#5 0x000000000057dc96 in Creature::Update (this=0x7f0be288e080,

update_diff=100, diff=100) at ../../../src/game/Creature.cpp:556

No locals.

Link to comment
Share on other sites

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use