From 08b8dd10d1f6d1564eb5063f333ef3a958e76bb1 Mon Sep 17 00:00:00 2001 From: DDuarte Date: Mon, 1 Jun 2015 02:09:45 +0100 Subject: [PATCH] Core/GOs: Correct type of lowGuid when loading gameobject_addons Coverity IDs: 1302436 1302437 1302438 Issue introduced in 95b5e357451985fbc350bf1321ce96d6c02f9d44 --- sql/updates/world/2015_06_01_00_world.sql | 1 + src/server/game/Globals/ObjectMgr.cpp | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) create mode 100644 sql/updates/world/2015_06_01_00_world.sql diff --git a/sql/updates/world/2015_06_01_00_world.sql b/sql/updates/world/2015_06_01_00_world.sql new file mode 100644 index 0000000000..8ba1d65ec5 --- /dev/null +++ b/sql/updates/world/2015_06_01_00_world.sql @@ -0,0 +1 @@ +ALTER TABLE `gameobject_addon` MODIFY `guid` int(10) unsigned NOT NULL DEFAULT '0'; diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index a3414c7261..e540824e71 100644 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -1057,12 +1057,12 @@ void ObjectMgr::LoadGameObjectAddons() { Field* fields = result->Fetch(); - ObjectGuid::LowType guid = fields[0].GetUInt64(); + ObjectGuid::LowType guid = fields[0].GetUInt32(); const GameObjectData* goData = GetGOData(guid); if (!goData) { - TC_LOG_ERROR("sql.sql", "GameObject (GUID: " UI64FMTD ") does not exist but has a record in `gameobject_addon`", guid); + TC_LOG_ERROR("sql.sql", "GameObject (GUID: %u) does not exist but has a record in `gameobject_addon`", guid); continue; } @@ -1072,14 +1072,14 @@ void ObjectMgr::LoadGameObjectAddons() if (gameObjectAddon.invisibilityType >= TOTAL_INVISIBILITY_TYPES) { - TC_LOG_ERROR("sql.sql", "GameObject (GUID: " UI64FMTD ") has invalid InvisibilityType in `gameobject_addon`", guid); + TC_LOG_ERROR("sql.sql", "GameObject (GUID: %u) has invalid InvisibilityType in `gameobject_addon`", guid); gameObjectAddon.invisibilityType = INVISIBILITY_GENERAL; gameObjectAddon.InvisibilityValue = 0; } if (gameObjectAddon.invisibilityType && !gameObjectAddon.InvisibilityValue) { - TC_LOG_ERROR("sql.sql", "GameObject (GUID: " UI64FMTD ") has InvisibilityType set but has no InvisibilityValue in `gameobject_addon`, set to 1", guid); + TC_LOG_ERROR("sql.sql", "GameObject (GUID: %u) has InvisibilityType set but has no InvisibilityValue in `gameobject_addon`, set to 1", guid); gameObjectAddon.InvisibilityValue = 1; }