aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorVincent-Michael <Vincent_Michael@gmx.de>2014-10-04 16:19:25 +0200
committerVincent-Michael <Vincent_Michael@gmx.de>2014-10-04 16:19:52 +0200
commita21149e1b7fc310626343b5b023805e3dc7483ec (patch)
tree53712724b93b7e762ca4bfecc18919fbd835bf99 /src
parent4c4f2b5645ba6952572e0f6c587d1557c22f96e6 (diff)
Core/SAI: Added new error log is not using SmartAI / SmartGameObjectAI in db
Diffstat (limited to 'src')
-rw-r--r--src/server/game/AI/SmartScripts/SmartScriptMgr.cpp34
1 files changed, 31 insertions, 3 deletions
diff --git a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp
index 74ecbaa19da..a5edc9e63d3 100644
--- a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp
+++ b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp
@@ -144,20 +144,34 @@ void SmartAIMgr::LoadSmartAIFromDB()
{
case SMART_SCRIPT_TYPE_CREATURE:
{
- if (!sObjectMgr->GetCreatureTemplate((uint32)temp.entryOrGuid))
+ CreatureTemplate const* creatureInfo = sObjectMgr->GetCreatureTemplate((uint32)temp.entryOrGuid);
+ if (!creatureInfo)
{
TC_LOG_ERROR("sql.sql", "SmartAIMgr::LoadSmartAIFromDB: Creature entry (%u) does not exist, skipped loading.", uint32(temp.entryOrGuid));
continue;
}
+
+ if (creatureInfo->AIName != "SmartAI")
+ {
+ TC_LOG_ERROR("sql.sql", "SmartAIMgr::LoadSmartAIFromDB: Creature entry (%u) is not using SmartAI, skipped loading.", uint32(temp.entryOrGuid));
+ continue;
+ }
break;
}
case SMART_SCRIPT_TYPE_GAMEOBJECT:
{
- if (!sObjectMgr->GetGameObjectTemplate((uint32)temp.entryOrGuid))
+ GameObjectTemplate const* gameObjectInfo = sObjectMgr->GetGameObjectTemplate((uint32)temp.entryOrGuid);
+ if (!gameObjectInfo)
{
TC_LOG_ERROR("sql.sql", "SmartAIMgr::LoadSmartAIFromDB: GameObject entry (%u) does not exist, skipped loading.", uint32(temp.entryOrGuid));
continue;
}
+
+ if (gameObjectInfo->AIName != "SmartGameObjectAI")
+ {
+ TC_LOG_ERROR("sql.sql", "SmartAIMgr::LoadSmartAIFromDB: GameObject entry (%u) is not using SmartGameObjectAI, skipped loading.", uint32(temp.entryOrGuid));
+ continue;
+ }
break;
}
case SMART_SCRIPT_TYPE_AREATRIGGER:
@@ -178,11 +192,25 @@ void SmartAIMgr::LoadSmartAIFromDB()
}
else
{
- if (!sObjectMgr->GetCreatureData(uint32(abs(temp.entryOrGuid))))
+ CreatureData const* creature = sObjectMgr->GetCreatureData(uint32(abs(temp.entryOrGuid)));
+ if (!creature)
{
TC_LOG_ERROR("sql.sql", "SmartAIMgr::LoadSmartAIFromDB: Creature guid (%u) does not exist, skipped loading.", uint32(abs(temp.entryOrGuid)));
continue;
}
+
+ CreatureTemplate const* creatureInfo = sObjectMgr->GetCreatureTemplate(creature->id);
+ if (!creatureInfo)
+ {
+ TC_LOG_ERROR("sql.sql", "SmartAIMgr::LoadSmartAIFromDB: Creature entry (%u) does not exist, skipped loading.", uint32(temp.entryOrGuid));
+ continue;
+ }
+
+ if (creatureInfo->AIName != "SmartAI")
+ {
+ TC_LOG_ERROR("sql.sql", "SmartAIMgr::LoadSmartAIFromDB: Creature entry (%u) is not using SmartAI, skipped loading.", uint32(temp.entryOrGuid));
+ continue;
+ }
}
temp.source_type = source_type;