# HG changeset patch # User James D. Callahan III # Date 1335766590 18000 # Node ID 17900d196389a66ec87ead821794deb720675a6b # Parent e987658a8c7d6e1dbaba63bad9659c6d2a4b6e8a Cleanup. diff -r e987658a8c7d -r 17900d196389 Main.lua --- a/Main.lua Mon Apr 30 00:57:32 2012 -0500 +++ b/Main.lua Mon Apr 30 01:16:30 2012 -0500 @@ -38,8 +38,8 @@ local EVENT_MAPPING = { LOOT_OPENED = true, - MERCHANT_SHOW = "MERCHANT_UPDATE", - MERCHANT_UPDATE = true, + MERCHANT_SHOW = "UpdateMerchantItems", + MERCHANT_UPDATE = "UpdateMerchantItems", PLAYER_TARGET_CHANGED = true, UNIT_QUEST_LOG_CHANGED = true, UNIT_SPELLCAST_FAILED = "HandleSpellFailure", @@ -110,8 +110,7 @@ if not item_link then return end - local id = item_link:match("item:(%d+)") - return id and tonumber(id) or nil + return tonumber(item_link:match("item:(%d+)")) end @@ -305,7 +304,7 @@ } -function WDP:MERCHANT_UPDATE() +function WDP:UpdateMerchantItems() local unit_type, unit_idnum = self:ParseGUID(_G.UnitGUID("target")) if unit_type ~= private.UNIT_TYPES.NPC or not unit_idnum then