Changeset 3199

Show
Ignore:
Timestamp:
03/06/2010 07:26:11 AM (6 months ago)
Author:
jackpoz
Message:

FIXED: Failed assertion triggered when a Pet/Summon went out of range from summoner Player. Report any issue at the Trac.

Location:
trunk/src/arcemu-world
Files:
4 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/arcemu-world/Object.cpp

    r3194 r3199  
    26082608                                        } 
    26092609 
    2610                                         pPet->DelayedRemove( false, true ); 
     2610                                        pPet->DelayedRemove( false ); 
    26112611                                } 
    26122612                                /* ----------------------------- PET DEATH HANDLING END -------------- */ 
  • trunk/src/arcemu-world/Pet.cpp

    r3138 r3199  
    844844} 
    845845 
    846 void Pet::DelayedRemove( bool bTime, bool bDeath ) 
     846void Pet::DelayedRemove( bool bTime, uint32 delay ) 
    847847{ 
    848848        // called when pet has died 
     
    855855        } 
    856856        else 
    857                 sEventMgr.AddEvent(this, &Pet::DelayedRemove, true, bDeath, EVENT_PET_DELAYED_REMOVE, PET_DELAYED_REMOVAL_TIME, 1, EVENT_FLAG_DO_NOT_EXECUTE_IN_WORLD_CONTEXT); 
     857                sEventMgr.AddEvent(this, &Pet::DelayedRemove, true, uint32(0), EVENT_PET_DELAYED_REMOVE, delay, 1, EVENT_FLAG_DO_NOT_EXECUTE_IN_WORLD_CONTEXT); 
    858858} 
    859859 
  • trunk/src/arcemu-world/Pet.h

    r3138 r3199  
    168168        void setDeathState(DeathState s); 
    169169 
    170         void DelayedRemove(bool bTime, bool bDeath); 
     170        void DelayedRemove(bool bTime, uint32 delay = PET_DELAYED_REMOVAL_TIME); 
    171171 
    172172        ARCEMU_INLINE Player* GetPetOwner() { return m_Owner; } 
  • trunk/src/arcemu-world/Player.cpp

    r3181 r3199  
    60396039                if( pObj == summon ) 
    60406040                { 
    6041                         if( summon->IsSummon() ) 
    6042                                 summon->Dismiss();                      // summons 
    6043                         else 
    6044                                 summon->Remove( true, false );// hunter pets 
     6041                        summon->DelayedRemove(false,1);//otherwise Pet::Update() will access free'd memory 
    60456042                        return; 
    60466043                } 
     
    60486045 
    60496046    if( pObj->GetGUID() == GetSummonedUnitGUID() ) 
    6050                 RemoveFieldSummon(); 
     6047                sEventMgr.AddEvent(TO_UNIT(this), &Unit::RemoveFieldSummon, EVENT_SUMMON_EXPIRE, 1, 1, EVENT_FLAG_DO_NOT_EXECUTE_IN_WORLD_CONTEXT);//otherwise Creature::Update() will access free'd memory 
    60516048} 
    60526049