aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Globals/ObjectMgr.cpp
diff options
context:
space:
mode:
authorfunjoker <torti-esser@web.de>2017-11-05 20:24:45 +0100
committerjoschiwald <joschiwald.trinity@gmail.com>2017-11-05 20:24:45 +0100
commitc77e76fa61a620affdfe60ae2dae639f95091e1b (patch)
tree20a7d4748969f0140ad62b7407a9566c3cebe3ed /src/server/game/Globals/ObjectMgr.cpp
parent983b0a5fcf48494a113a108cd6ccc9230094cc4c (diff)
Core/Gameobject: Add WorldEffectID to Gameobject (#20785)
Diffstat (limited to 'src/server/game/Globals/ObjectMgr.cpp')
-rw-r--r--src/server/game/Globals/ObjectMgr.cpp30
1 files changed, 22 insertions, 8 deletions
diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp
index 928de3d872e..c2020bbba10 100644
--- a/src/server/game/Globals/ObjectMgr.cpp
+++ b/src/server/game/Globals/ObjectMgr.cpp
@@ -1201,8 +1201,8 @@ void ObjectMgr::LoadGameObjectAddons()
{
uint32 oldMSTime = getMSTime();
- // 0 1 2 3 4 5 6
- QueryResult result = WorldDatabase.Query("SELECT guid, parent_rotation0, parent_rotation1, parent_rotation2, parent_rotation3, invisibilityType, invisibilityValue FROM gameobject_addon");
+ // 0 1 2 3 4 5 6 7
+ QueryResult result = WorldDatabase.Query("SELECT guid, parent_rotation0, parent_rotation1, parent_rotation2, parent_rotation3, invisibilityType, invisibilityValue, WorldEffectID FROM gameobject_addon");
if (!result)
{
@@ -1228,6 +1228,7 @@ void ObjectMgr::LoadGameObjectAddons()
gameObjectAddon.ParentRotation = QuaternionData(fields[1].GetFloat(), fields[2].GetFloat(), fields[3].GetFloat(), fields[4].GetFloat());
gameObjectAddon.invisibilityType = InvisibilityType(fields[5].GetUInt8());
gameObjectAddon.InvisibilityValue = fields[6].GetUInt32();
+ gameObjectAddon.WorldEffectID = fields[7].GetUInt32();
if (gameObjectAddon.invisibilityType >= TOTAL_INVISIBILITY_TYPES)
{
@@ -1248,6 +1249,12 @@ void ObjectMgr::LoadGameObjectAddons()
gameObjectAddon.ParentRotation = QuaternionData();
}
+ if (gameObjectAddon.WorldEffectID && !sWorldEffectStore.LookupEntry(gameObjectAddon.WorldEffectID))
+ {
+ TC_LOG_ERROR("sql.sql", "GameObject (GUID: " UI64FMTD ") has invalid WorldEffectID (%u) in `gameobject_addon`, set to 0.", guid, gameObjectAddon.WorldEffectID);
+ gameObjectAddon.WorldEffectID = 0;
+ }
+
++count;
}
while (result->NextRow());
@@ -7132,8 +7139,8 @@ void ObjectMgr::LoadGameObjectTemplateAddons()
{
uint32 oldMSTime = getMSTime();
- // 0 1 2 3 4
- QueryResult result = WorldDatabase.Query("SELECT entry, faction, flags, mingold, maxgold FROM gameobject_template_addon");
+ // 0 1 2 3 4 5
+ QueryResult result = WorldDatabase.Query("SELECT entry, faction, flags, mingold, maxgold, WorldEffectID FROM gameobject_template_addon");
if (!result)
{
@@ -7156,10 +7163,11 @@ void ObjectMgr::LoadGameObjectTemplateAddons()
}
GameObjectTemplateAddon& gameObjectAddon = _gameObjectTemplateAddonStore[entry];
- gameObjectAddon.faction = uint32(fields[1].GetUInt16());
- gameObjectAddon.flags = fields[2].GetUInt32();
- gameObjectAddon.mingold = fields[3].GetUInt32();
- gameObjectAddon.maxgold = fields[4].GetUInt32();
+ gameObjectAddon.faction = uint32(fields[1].GetUInt16());
+ gameObjectAddon.flags = fields[2].GetUInt32();
+ gameObjectAddon.mingold = fields[3].GetUInt32();
+ gameObjectAddon.maxgold = fields[4].GetUInt32();
+ gameObjectAddon.WorldEffectID = fields[5].GetUInt32();
// checks
if (gameObjectAddon.faction && !sFactionTemplateStore.LookupEntry(gameObjectAddon.faction))
@@ -7178,6 +7186,12 @@ void ObjectMgr::LoadGameObjectTemplateAddons()
}
}
+ if (gameObjectAddon.WorldEffectID && !sWorldEffectStore.LookupEntry(gameObjectAddon.WorldEffectID))
+ {
+ TC_LOG_ERROR("sql.sql", "GameObject (Entry: %u) has invalid WorldEffectID (%u) defined in `gameobject_template_addon`, set to 0.", entry, gameObjectAddon.WorldEffectID);
+ gameObjectAddon.WorldEffectID = 0;
+ }
+
++count;
}
while (result->NextRow());