From 3746c1d8a38dd59699e4ae33501c9477ffe13289 Mon Sep 17 00:00:00 2001 From: Shadez Date: Wed, 19 Jan 2011 22:03:49 +0800 Subject: [PATCH] [460] Correct SQL query for TC case in Items::GetItemGUIDByEntry(). --- includes/classes/class.items.php | 12 ++++++++++-- includes/revision_nr.php | 2 +- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/includes/classes/class.items.php b/includes/classes/class.items.php index 774989a6f..81aad5953 100644 --- a/includes/classes/class.items.php +++ b/includes/classes/class.items.php @@ -3,7 +3,7 @@ /** * @package World of Warcraft Armory * @version Release 4.50 - * @revision 456 + * @revision 460 * @copyright (c) 2009-2011 Shadez * @license http://opensource.org/licenses/gpl-license.php GNU Public License * @@ -3032,7 +3032,15 @@ public function GetItemEntryByGUID($item_guid) { * @return int **/ public function GetItemGUIDByEntry($item_entry, $owner_guid) { - return Armory::$cDB->selectCell("SELECT `item` FROM `character_inventory` WHERE `item_template`=%d AND `owner_guid`=%d", $item_entry, $owner_guid); + switch(Armory::$currentRealmInfo['type']) { + case SERVER_MANGOS: + return Armory::$cDB->selectCell("SELECT `item` FROM `character_inventory` WHERE `item_template`=%d AND `owner_guid`=%d", $item_entry, $owner_guid); + break; + case SERVER_TRINITY: + return Armory::$cDB->selectCell("SELECT `guid` FROM `item_instance` WHERE `itemEntry`=%d AND `owner_guid`=%d", $item_entry, $owner_guid); + break; + } + return 0; } public function IsGemMatchesSocketColor($gem_color, $socket_color) { diff --git a/includes/revision_nr.php b/includes/revision_nr.php index adc4722e2..5289c225f 100644 --- a/includes/revision_nr.php +++ b/includes/revision_nr.php @@ -1,5 +1,5 @@ \ No newline at end of file