Merge branch '4.3.4' of https://gitlab.com/trinitycore/TrinityCore_434 into ShatteredWorld

# Conflicts:
#	src/server/scripts/EasternKingdoms/ShadowfangKeep/instance_shadowfang_keep.cpp
#	src/server/scripts/EasternKingdoms/ShadowfangKeep/shadowfang_keep.cpp
#	src/server/scripts/EasternKingdoms/ShadowfangKeep/shadowfang_keep.h
This commit is contained in:
Ovahlord committed 2018-01-02 01:23:06 +01:00
commit 98fdf72c7b
1535 files changed
+2852 -2917

No files matched your search

+17 -10
View File
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2008-2017 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2008-2018 TrinityCore <https://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -906,16 +906,23 @@ void ObjectMgr::CheckCreatureTemplate(CreatureTemplate const* cInfo)
const_cast<CreatureTemplate*>(cInfo)->maxgold = cInfo->mingold;
}
if (cInfo->AIName == "TotemAI" || cInfo->AIName == "PetAI")
if (!cInfo->AIName.empty())
{
TC_LOG_ERROR("sql.sql", "Creature (Entry: %u) has not-allowed `AIName` '%s' set, removing", cInfo->Entry, cInfo->AIName.c_str());
const_cast<CreatureTemplate*>(cInfo)->AIName.clear();
}
if (!cInfo->AIName.empty() && !sCreatureAIRegistry->HasItem(cInfo->AIName))
{
TC_LOG_ERROR("sql.sql", "Creature (Entry: %u) has non-registered `AIName` '%s' set, removing", cInfo->Entry, cInfo->AIName.c_str());
const_cast<CreatureTemplate*>(cInfo)->AIName.clear();
auto registryItem = sCreatureAIRegistry->GetRegistryItem(cInfo->AIName);
if (!registryItem)
{
TC_LOG_ERROR("sql.sql", "Creature (Entry: %u) has non-registered `AIName` '%s' set, removing", cInfo->Entry, cInfo->AIName.c_str());
const_cast<CreatureTemplate*>(cInfo)->AIName.clear();
}
else
{
DBPermit const* permit = dynamic_cast<DBPermit const*>(registryItem);
if (!ASSERT_NOTNULL(permit)->IsScriptNameAllowedInDB())
{
TC_LOG_ERROR("sql.sql", "Creature (Entry: %u) has not-allowed `AIName` '%s' set, removing", cInfo->Entry, cInfo->AIName.c_str());
const_cast<CreatureTemplate*>(cInfo)->AIName.clear();
}
}
}
FactionTemplateEntry const* factionTemplate = sFactionTemplateStore.LookupEntry(cInfo->faction);