diff Main.lua @ 7:17900d196389

Cleanup.
author James D. Callahan III <jcallahan@curse.com>
date Mon, 30 Apr 2012 01:16:30 -0500
parents e987658a8c7d
children 1b4111ac80c6
line wrap: on
line diff
--- 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