View Single Post
  #1  
Old 09-05-2008, 12:45 AM
Hugghiebear
Fire Beetle
 
Join Date: Apr 2008
Location: Earth
Posts: 10
Default

I will make sure to check that further pointers are valid. I've edited this code and tested it without a pet, with an enchanter animation, and with a charmed pet. All work properly with no crashes now.

My thanks to Cavedude for catching the bug (as well as running TGC and PEQ... my son and I enjoy your server).


Code:
void Mob::SetInvisible(bool state)
{
    invisible = state;
    SendAppearancePacket(AT_Invis, invisible);
    // Invis breaks charms

    if ((this->GetPetType() == petCharmed) && invisible)
    {
        Mob* formerpet = this->GetPet();

        if(formerpet)
             formerpet->BuffFadeByEffect(SE_Charm);
    }
}

Last edited by cavedude; 09-24-2008 at 10:10 PM.. Reason: Added Code box
Reply With Quote