aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Globals/ObjectMgr.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/game/Globals/ObjectMgr.cpp')
-rw-r--r--src/server/game/Globals/ObjectMgr.cpp40
1 files changed, 23 insertions, 17 deletions
diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp
index f1bbb1d6839..9987019d75d 100644
--- a/src/server/game/Globals/ObjectMgr.cpp
+++ b/src/server/game/Globals/ObjectMgr.cpp
@@ -240,7 +240,8 @@ ObjectMgr::ObjectMgr():
_hiDoGuid(1),
_hiCorpseGuid(1),
_hiAreaTriggerGuid(1),
- _hiMoTransGuid(1)
+ _hiMoTransGuid(1),
+ DBCLocaleIndex(LOCALE_enUS)
{
for (uint8 i = 0; i < MAX_CLASSES; ++i)
for (uint8 j = 0; j < MAX_RACES; ++j)
@@ -1266,7 +1267,7 @@ void ObjectMgr::LoadLinkedRespawn()
const CreatureData* slave = GetCreatureData(guidLow);
if (!slave)
{
- TC_LOG_ERROR("sql.sql", "Couldn't get creature data for GUIDLow %u", guidLow);
+ TC_LOG_ERROR("sql.sql", "LinkedRespawn: Creature (guid) '%u' not found in creature table", guidLow);
error = true;
break;
}
@@ -1274,7 +1275,7 @@ void ObjectMgr::LoadLinkedRespawn()
const CreatureData* master = GetCreatureData(linkedGuidLow);
if (!master)
{
- TC_LOG_ERROR("sql.sql", "Couldn't get creature data for GUIDLow %u", linkedGuidLow);
+ TC_LOG_ERROR("sql.sql", "LinkedRespawn: Creature (linkedGuid) '%u' not found in creature table", linkedGuidLow);
error = true;
break;
}
@@ -1282,14 +1283,14 @@ void ObjectMgr::LoadLinkedRespawn()
const MapEntry* const map = sMapStore.LookupEntry(master->mapid);
if (!map || !map->Instanceable() || (master->mapid != slave->mapid))
{
- TC_LOG_ERROR("sql.sql", "Creature '%u' linking to '%u' on an unpermitted map.", guidLow, linkedGuidLow);
+ TC_LOG_ERROR("sql.sql", "LinkedRespawn: Creature '%u' linking to Creature '%u' on an unpermitted map.", guidLow, linkedGuidLow);
error = true;
break;
}
if (!(master->spawnMask & slave->spawnMask)) // they must have a possibility to meet (normal/heroic difficulty)
{
- TC_LOG_ERROR("sql.sql", "LinkedRespawn: Creature '%u' linking to '%u' with not corresponding spawnMask", guidLow, linkedGuidLow);
+ TC_LOG_ERROR("sql.sql", "LinkedRespawn: Creature '%u' linking to Creature '%u' with not corresponding spawnMask", guidLow, linkedGuidLow);
error = true;
break;
}
@@ -1303,7 +1304,7 @@ void ObjectMgr::LoadLinkedRespawn()
const CreatureData* slave = GetCreatureData(guidLow);
if (!slave)
{
- TC_LOG_ERROR("sql.sql", "Couldn't get creature data for GUIDLow %u", guidLow);
+ TC_LOG_ERROR("sql.sql", "LinkedRespawn: Creature (guid) '%u' not found in creature table", guidLow);
error = true;
break;
}
@@ -1311,7 +1312,7 @@ void ObjectMgr::LoadLinkedRespawn()
const GameObjectData* master = GetGOData(linkedGuidLow);
if (!master)
{
- TC_LOG_ERROR("sql.sql", "Couldn't get gameobject data for GUIDLow %u", linkedGuidLow);
+ TC_LOG_ERROR("sql.sql", "LinkedRespawn: Gameobject (linkedGuid) '%u' not found in gameobject table", linkedGuidLow);
error = true;
break;
}
@@ -1319,14 +1320,14 @@ void ObjectMgr::LoadLinkedRespawn()
const MapEntry* const map = sMapStore.LookupEntry(master->mapid);
if (!map || !map->Instanceable() || (master->mapid != slave->mapid))
{
- TC_LOG_ERROR("sql.sql", "Creature '%u' linking to '%u' on an unpermitted map.", guidLow, linkedGuidLow);
+ TC_LOG_ERROR("sql.sql", "LinkedRespawn: Creature '%u' linking to Gameobject '%u' on an unpermitted map.", guidLow, linkedGuidLow);
error = true;
break;
}
if (!(master->spawnMask & slave->spawnMask)) // they must have a possibility to meet (normal/heroic difficulty)
{
- TC_LOG_ERROR("sql.sql", "LinkedRespawn: Creature '%u' linking to '%u' with not corresponding spawnMask", guidLow, linkedGuidLow);
+ TC_LOG_ERROR("sql.sql", "LinkedRespawn: Creature '%u' linking to Gameobject '%u' with not corresponding spawnMask", guidLow, linkedGuidLow);
error = true;
break;
}
@@ -1340,7 +1341,7 @@ void ObjectMgr::LoadLinkedRespawn()
const GameObjectData* slave = GetGOData(guidLow);
if (!slave)
{
- TC_LOG_ERROR("sql.sql", "Couldn't get gameobject data for GUIDLow %u", guidLow);
+ TC_LOG_ERROR("sql.sql", "LinkedRespawn: Gameobject (guid) '%u' not found in gameobject table", guidLow);
error = true;
break;
}
@@ -1348,7 +1349,7 @@ void ObjectMgr::LoadLinkedRespawn()
const GameObjectData* master = GetGOData(linkedGuidLow);
if (!master)
{
- TC_LOG_ERROR("sql.sql", "Couldn't get gameobject data for GUIDLow %u", linkedGuidLow);
+ TC_LOG_ERROR("sql.sql", "LinkedRespawn: Gameobject (linkedGuid) '%u' not found in gameobject table", linkedGuidLow);
error = true;
break;
}
@@ -1356,14 +1357,14 @@ void ObjectMgr::LoadLinkedRespawn()
const MapEntry* const map = sMapStore.LookupEntry(master->mapid);
if (!map || !map->Instanceable() || (master->mapid != slave->mapid))
{
- TC_LOG_ERROR("sql.sql", "Creature '%u' linking to '%u' on an unpermitted map.", guidLow, linkedGuidLow);
+ TC_LOG_ERROR("sql.sql", "LinkedRespawn: Gameobject '%u' linking to Gameobject '%u' on an unpermitted map.", guidLow, linkedGuidLow);
error = true;
break;
}
if (!(master->spawnMask & slave->spawnMask)) // they must have a possibility to meet (normal/heroic difficulty)
{
- TC_LOG_ERROR("sql.sql", "LinkedRespawn: Creature '%u' linking to '%u' with not corresponding spawnMask", guidLow, linkedGuidLow);
+ TC_LOG_ERROR("sql.sql", "LinkedRespawn: Gameobject '%u' linking to Gameobject '%u' with not corresponding spawnMask", guidLow, linkedGuidLow);
error = true;
break;
}
@@ -1377,7 +1378,7 @@ void ObjectMgr::LoadLinkedRespawn()
const GameObjectData* slave = GetGOData(guidLow);
if (!slave)
{
- TC_LOG_ERROR("sql.sql", "Couldn't get gameobject data for GUIDLow %u", guidLow);
+ TC_LOG_ERROR("sql.sql", "LinkedRespawn: Gameobject (guid) '%u' not found in gameobject table", guidLow);
error = true;
break;
}
@@ -1385,7 +1386,7 @@ void ObjectMgr::LoadLinkedRespawn()
const CreatureData* master = GetCreatureData(linkedGuidLow);
if (!master)
{
- TC_LOG_ERROR("sql.sql", "Couldn't get creature data for GUIDLow %u", linkedGuidLow);
+ TC_LOG_ERROR("sql.sql", "LinkedRespawn: Creature (linkedGuid) '%u' not found in creature table", linkedGuidLow);
error = true;
break;
}
@@ -1393,14 +1394,14 @@ void ObjectMgr::LoadLinkedRespawn()
const MapEntry* const map = sMapStore.LookupEntry(master->mapid);
if (!map || !map->Instanceable() || (master->mapid != slave->mapid))
{
- TC_LOG_ERROR("sql.sql", "Creature '%u' linking to '%u' on an unpermitted map.", guidLow, linkedGuidLow);
+ TC_LOG_ERROR("sql.sql", "LinkedRespawn: Gameobject '%u' linking to Creature '%u' on an unpermitted map.", guidLow, linkedGuidLow);
error = true;
break;
}
if (!(master->spawnMask & slave->spawnMask)) // they must have a possibility to meet (normal/heroic difficulty)
{
- TC_LOG_ERROR("sql.sql", "LinkedRespawn: Creature '%u' linking to '%u' with not corresponding spawnMask", guidLow, linkedGuidLow);
+ TC_LOG_ERROR("sql.sql", "LinkedRespawn: Gameobject '%u' linking to Creature '%u' with not corresponding spawnMask", guidLow, linkedGuidLow);
error = true;
break;
}
@@ -1437,6 +1438,11 @@ bool ObjectMgr::SetCreatureLinkedRespawn(uint32 guidLow, uint32 linkedGuidLow)
}
const CreatureData* slave = GetCreatureData(linkedGuidLow);
+ if (!slave)
+ {
+ TC_LOG_ERROR("sql.sql", "Creature '%u' linking to non-existent creature '%u'.", guidLow, linkedGuidLow);
+ return false;
+ }
const MapEntry* const map = sMapStore.LookupEntry(master->mapid);
if (!map || !map->Instanceable() || (master->mapid != slave->mapid))