Core: header cleanup, split realmlist, boost compatibility, cotire, remove stormlib/zlib and stormlib/bzip2 and instead use dep sources

This commit is contained in:
ariel- committed 2018-03-28 04:41:59 -03:00
1 parent 7fff6c424f
commit 5ff847159c
1243 files changed
+29780 -36517

No files matched your search

+27 -24
View File
@@ -15,12 +15,13 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "Spell.h"
#include "SpellScript.h"
#include "Log.h"
#include "ScriptMgr.h"
#include "Spell.h"
#include "SpellAuras.h"
#include "SpellMgr.h"
#include "SpellScript.h"
#include "SpellMgr.h"
#include <sstream>
#include <string>
bool _SpellScript::_Validate(SpellInfo const* entry)
@@ -33,18 +34,20 @@ bool _SpellScript::_Validate(SpellInfo const* entry)
return true;
}
bool _SpellScript::ValidateSpellInfo(std::vector<uint32> const& spellIds)
bool _SpellScript::_ValidateSpellInfo(uint32 const* begin, uint32 const* end)
{
for (uint32 spellId : spellIds)
bool allValid = true;
while (begin != end)
{
if (!sSpellMgr->GetSpellInfo(spellId))
if (!sSpellMgr->GetSpellInfo(*begin))
{
TC_LOG_ERROR("scripts.spells", "_SpellScript::ValidateSpellInfo: Spell %u does not exist.", spellId);
return false;
TC_LOG_ERROR("scripts.spells", "_SpellScript::ValidateSpellInfo: Spell %u does not exist.", *begin);
allValid = false;
}
}
return true;
++begin;
}
return allValid;
}
void _SpellScript::_Register()
@@ -438,7 +441,7 @@ WorldLocation const* SpellScript::GetExplTargetDest() const
{
if (m_spell->m_targets.HasDst())
return m_spell->m_targets.GetDstPos();
return NULL;
return nullptr;
}
void SpellScript::SetExplTargetDest(WorldLocation& loc)
@@ -471,7 +474,7 @@ Unit* SpellScript::GetHitUnit() const
if (!IsInTargetHook())
{
TC_LOG_ERROR("scripts", "Script: `%s` Spell: `%u`: function SpellScript::GetHitUnit was called, but function has no effect in current hook!", m_scriptName->c_str(), m_scriptSpellId);
return NULL;
return nullptr;
}
return m_spell->unitTarget;
}
@@ -481,12 +484,12 @@ Creature* SpellScript::GetHitCreature() const
if (!IsInTargetHook())
{
TC_LOG_ERROR("scripts", "Script: `%s` Spell: `%u`: function SpellScript::GetHitCreature was called, but function has no effect in current hook!", m_scriptName->c_str(), m_scriptSpellId);
return NULL;
return nullptr;
}
if (m_spell->unitTarget)
return m_spell->unitTarget->ToCreature();
else
return NULL;
return nullptr;
}
Player* SpellScript::GetHitPlayer() const
@@ -494,12 +497,12 @@ Player* SpellScript::GetHitPlayer() const
if (!IsInTargetHook())
{
TC_LOG_ERROR("scripts", "Script: `%s` Spell: `%u`: function SpellScript::GetHitPlayer was called, but function has no effect in current hook!", m_scriptName->c_str(), m_scriptSpellId);
return NULL;
return nullptr;
}
if (m_spell->unitTarget)
return m_spell->unitTarget->ToPlayer();
else
return NULL;
return nullptr;
}
Item* SpellScript::GetHitItem() const
@@ -507,7 +510,7 @@ Item* SpellScript::GetHitItem() const
if (!IsInTargetHook())
{
TC_LOG_ERROR("scripts", "Script: `%s` Spell: `%u`: function SpellScript::GetHitItem was called, but function has no effect in current hook!", m_scriptName->c_str(), m_scriptSpellId);
return NULL;
return nullptr;
}
return m_spell->itemTarget;
}
@@ -517,7 +520,7 @@ GameObject* SpellScript::GetHitGObj() const
if (!IsInTargetHook())
{
TC_LOG_ERROR("scripts", "Script: `%s` Spell: `%u`: function SpellScript::GetHitGObj was called, but function has no effect in current hook!", m_scriptName->c_str(), m_scriptSpellId);
return NULL;
return nullptr;
}
return m_spell->gameObjTarget;
}
@@ -527,7 +530,7 @@ WorldLocation* SpellScript::GetHitDest() const
if (!IsInEffectHook())
{
TC_LOG_ERROR("scripts", "Script: `%s` Spell: `%u`: function SpellScript::GetHitDest was called, but function has no effect in current hook!", m_scriptName->c_str(), m_scriptSpellId);
return NULL;
return nullptr;
}
return m_spell->destTarget;
}
@@ -577,12 +580,12 @@ Aura* SpellScript::GetHitAura() const
if (!IsInTargetHook())
{
TC_LOG_ERROR("scripts", "Script: `%s` Spell: `%u`: function SpellScript::GetHitAura was called, but function has no effect in current hook!", m_scriptName->c_str(), m_scriptSpellId);
return NULL;
return nullptr;
}
if (!m_spell->m_spellAura)
return NULL;
return nullptr;
if (m_spell->m_spellAura->IsRemoved())
return NULL;
return nullptr;
return m_spell->m_spellAura;
}
@@ -957,7 +960,7 @@ void AuraScript::EffectProcHandler::Call(AuraScript* auraScript, AuraEffect cons
bool AuraScript::_Load(Aura* aura)
{
m_aura = aura;
_PrepareScriptCall((AuraScriptHookType)SPELL_SCRIPT_STATE_LOADING, NULL);
_PrepareScriptCall((AuraScriptHookType)SPELL_SCRIPT_STATE_LOADING, nullptr);
bool load = Load();
_FinishScriptCall();
return load;
@@ -1205,7 +1208,7 @@ Unit* AuraScript::GetTarget() const
TC_LOG_ERROR("scripts", "Script: `%s` Spell: `%u` AuraScript::GetTarget called in a hook in which the call won't have effect!", m_scriptName->c_str(), m_scriptSpellId);
}
return NULL;
return nullptr;
}
AuraApplication const* AuraScript::GetTargetApplication() const