Changeset 3158
- Timestamp:
- 02/07/2010 02:33:38 PM (7 months ago)
- Location:
- trunk/src/arcemu-world
- Files:
-
- 2 modified
-
Creature.cpp (modified) (3 diffs)
-
Creature.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/arcemu-world/Creature.cpp
r3148 r3158 749 749 } 750 750 751 void Creature::RemoveFromWorld(bool free_guid) 752 { 753 PrepareForDeletion(); 754 Unit::RemoveFromWorld(free_guid); 755 } 756 751 757 void Creature::EnslaveExpire() 752 758 { … … 1834 1840 } 1835 1841 1836 //remove ai stuff 1837 sEventMgr.RemoveEvents( this, EVENT_CREATURE_AISPELL ); 1838 1839 if( GetScript() != NULL ) 1840 { 1841 GetScript()->Destroy(); 1842 _myScriptClass = NULL; 1843 } 1844 1845 RemoveAllAuras(); 1846 1847 // If we have a summons then let's remove them 1848 RemoveAllGuardians(); 1849 1850 // remove our reference from owner 1851 if( m_owner != NULL ) 1852 { 1853 m_owner->RemoveGuardianRef( this ); 1854 m_owner = NULL; 1855 } 1842 PrepareForDeletion(); 1856 1843 1857 1844 if(!IsInWorld()) 1858 1845 return; 1859 1860 if(GetMapMgr() && GetMapMgr()->GetMapInfo() && GetMapMgr()->GetMapInfo()->type == INSTANCE_RAID)1861 {1862 if(GetCreatureInfo() && GetCreatureInfo()->Rank == 3)1863 {1864 GetMapMgr()->RemoveCombatInProgress(GetGUID());1865 }1866 }1867 1846 1868 1847 if( IsPet() ) … … 2116 2095 (*itr)->RemoveSanctuaryFlag(); 2117 2096 } 2097 2098 void Creature::PrepareForDeletion() 2099 { 2100 //remove ai stuff 2101 sEventMgr.RemoveEvents( this, EVENT_CREATURE_AISPELL ); 2102 2103 if( GetScript() != NULL ) 2104 { 2105 GetScript()->Destroy(); 2106 _myScriptClass = NULL; 2107 } 2108 2109 RemoveAllAuras(); 2110 2111 // If we have a summons then let's remove them 2112 RemoveAllGuardians(); 2113 2114 // remove our reference from owner 2115 if( m_owner != NULL ) 2116 { 2117 m_owner->RemoveGuardianRef( this ); 2118 m_owner = NULL; 2119 } 2120 2121 if(!IsInWorld()) 2122 return; 2123 2124 if(GetMapMgr() && GetMapMgr()->GetMapInfo() && GetMapMgr()->GetMapInfo()->type == INSTANCE_RAID) 2125 { 2126 if(GetCreatureInfo() && GetCreatureInfo()->Rank == 3) 2127 { 2128 GetMapMgr()->RemoveCombatInProgress(GetGUID()); 2129 } 2130 } 2131 } -
trunk/src/arcemu-world/Creature.h
r3131 r3158 300 300 void AddToWorld(MapMgr * pMapMgr); 301 301 void RemoveFromWorld(bool addrespawnevent, bool free_guid); 302 void RemoveFromWorld(bool free_guid); 303 304 void PrepareForDeletion();//remove auras, guardians, scripts 302 305 303 306 /// Creation