--HG--
branch : trunk
This commit is contained in:
Trazom62
2010-01-29 19:49:46 +01:00
7 changed files with 143 additions and 120 deletions
+4
View File
@@ -18,6 +18,8 @@ class WDBThreadStartReq1 : public ACE_Method_Request
call (void)
{
WorldDatabase.ThreadStart();
CharacterDatabase.ThreadStart();
loginDatabase.ThreadStart();
return 0;
}
};
@@ -31,6 +33,8 @@ class WDBThreadEndReq1 : public ACE_Method_Request
call (void)
{
WorldDatabase.ThreadEnd();
CharacterDatabase.ThreadEnd();
loginDatabase.ThreadEnd();
return 0;
}
};
+3 -3
View File
@@ -3256,7 +3256,7 @@ void SpellMgr::LoadSpellRanks()
do
{
// spellid, rank
std::list<std::pair<int32, int32>> rankChain;
std::list < std::pair < int32, int32 > > rankChain;
int32 currentSpell = -1;
int32 lastSpell = -1;
@@ -3299,7 +3299,7 @@ void SpellMgr::LoadSpellRanks()
int32 curRank = 0;
bool valid = true;
// check spells in chain
for (std::list<std::pair<int32, int32>>::iterator itr = rankChain.begin() ; itr!= rankChain.end(); ++itr)
for (std::list<std::pair<int32, int32> >::iterator itr = rankChain.begin() ; itr!= rankChain.end(); ++itr)
{
SpellEntry const * spell = sSpellStore.LookupEntry(itr->first);
if (!spell)
@@ -3320,7 +3320,7 @@ void SpellMgr::LoadSpellRanks()
continue;
int32 prevRank = 0;
// insert the chain
std::list<std::pair<int32, int32>>::iterator itr = rankChain.begin();
std::list<std::pair<int32, int32> >::iterator itr = rankChain.begin();
do
{
int32 addedSpell = itr->first;
+33 -23
View File
@@ -4300,33 +4300,43 @@ void Unit::RemoveAurasWithMechanic(uint32 mechanic_mask, AuraRemoveMode removemo
void Unit::RemoveAreaAurasDueToLeaveWorld()
{
// make sure that all area auras not applied on self are removed - prevent access to deleted pointer later
for (AuraMap::iterator iter = m_ownedAuras.begin(); iter != m_ownedAuras.end();)
bool cleanRun;
do
{
Aura * aura = iter->second;
++iter;
Aura::ApplicationMap const & appMap = aura->GetApplicationMap();
for(Aura::ApplicationMap::const_iterator itr = appMap.begin(); itr!= appMap.end();)
cleanRun = true;
// make sure that all area auras not applied on self are removed - prevent access to deleted pointer later
for (AuraMap::iterator iter = m_ownedAuras.begin(); iter != m_ownedAuras.end();)
{
AuraApplication * aurApp = itr->second;
++itr;
Unit * target = aurApp->GetTarget();
if (target == this)
continue;
target->RemoveAura(aurApp);
// things linked on aura remove may apply new area aura - so start from the beginning
iter = m_ownedAuras.begin();
Aura * aura = iter->second;
++iter;
Aura::ApplicationMap const & appMap = aura->GetApplicationMap();
for(Aura::ApplicationMap::const_iterator itr = appMap.begin(); itr!= appMap.end();)
{
AuraApplication * aurApp = itr->second;
++itr;
Unit * target = aurApp->GetTarget();
if (target == this)
continue;
target->RemoveAura(aurApp);
cleanRun = false;
// things linked on aura remove may apply new area aura - so start from the beginning
iter = m_ownedAuras.begin();
}
}
// remove area auras owned by others
for (AuraApplicationMap::iterator iter = m_appliedAuras.begin(); iter != m_appliedAuras.end();)
{
if (iter->second->GetBase()->GetOwner()!=this)
{
RemoveAura(iter);
cleanRun = false;
}
else
++iter;
}
}
// remove area auras owned by others
for (AuraApplicationMap::iterator iter = m_appliedAuras.begin(); iter != m_appliedAuras.end();)
{
if (iter->second->GetBase()->GetOwner()!=this)
RemoveAura(iter);
else
++iter;
}
while (!cleanRun);
}
void Unit::RemoveAllAuras()
+6 -2
View File
@@ -154,7 +154,9 @@ class ReactorRunnable : protected ACE_Task_Base
{
DEBUG_LOG ("Network Thread Starting");
WorldDatabase.ThreadStart ();
WorldDatabase.ThreadStart();
CharacterDatabase.ThreadStart();
loginDatabase.ThreadStart();
ACE_ASSERT (m_Reactor);
@@ -187,7 +189,9 @@ class ReactorRunnable : protected ACE_Task_Base
}
}
WorldDatabase.ThreadEnd ();
WorldDatabase.ThreadEnd();
CharacterDatabase.ThreadEnd();
loginDatabase.ThreadEnd();
DEBUG_LOG ("Network Thread Exitting");