changeset 175:ac9f0ccb27a8

reputation_npc_id --> last_killed_npc_id and ClearReputationNPC --> ClearLastKilledNPC
author James D. Callahan III <jcallahan@curse.com>
date Thu, 01 Nov 2012 14:41:36 -0500
parents 85243603b34c
children 48b43068e2e0
files Main.lua
diffstat 1 files changed, 12 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/Main.lua	Wed Oct 17 11:52:00 2012 -0500
+++ b/Main.lua	Thu Nov 01 14:41:36 2012 -0500
@@ -135,7 +135,7 @@
 local forge_spell_ids = {}
 local languages_known = {}
 local name_to_id_map = {}
-local reputation_npc_id
+local last_killed_npc_id
 local target_location_timer_handle
 local current_target_id
 local current_area_id
@@ -276,9 +276,9 @@
 
 
 -- Called on a timer
-local function ClearReputationNPC()
-    Debug("Clearing reputation_npc_id")
-    reputation_npc_id = nil
+local function ClearLastKilledNPC()
+    Debug("Clearing last_killed_npc_id")
+    last_killed_npc_id = nil
 end
 
 
@@ -1132,12 +1132,12 @@
             local unit_type, unit_idnum = ParseGUID(dest_guid)
 
             if not unit_idnum or not UnitTypeIsNPC(unit_type) then
-                reputation_npc_id = nil
+                last_killed_npc_id = nil
                 private.harvesting = nil
                 return
             end
-            reputation_npc_id = unit_idnum
-            WDP:ScheduleTimer(ClearReputationNPC, 0.1)
+            last_killed_npc_id = unit_idnum
+            WDP:ScheduleTimer(ClearLastKilledNPC, 0.1)
         end,
     }
 
@@ -1218,7 +1218,7 @@
 
 
     function WDP:COMBAT_TEXT_UPDATE(event_name, message_type, faction_name, amount)
-        if message_type ~= "FACTION" or not reputation_npc_id then
+        if message_type ~= "FACTION" or not last_killed_npc_id then
             return
         end
         UpdateFactionData()
@@ -1226,8 +1226,8 @@
         if not faction_name or not faction_standings[faction_name] then
             return
         end
-        local npc = NPCEntry(reputation_npc_id)
-        reputation_npc_id = nil
+        local npc = NPCEntry(last_killed_npc_id)
+        last_killed_npc_id = nil
 
         if not npc then
             private.harvesting = nil
@@ -1769,7 +1769,7 @@
             quest.reward_text = ReplaceKeywords(_G.GetRewardText())
         end
         -- Make sure the quest NPC isn't erroneously recorded as giving reputation for quests which award it.
-        reputation_npc_id = nil
+        last_killed_npc_id = nil
     end
 
 
@@ -2000,7 +2000,7 @@
     private.previous_spell_id = spell_id
 
     if spell_name:match("^Harvest.+") then
-        reputation_npc_id = current_target_id
+        last_killed_npc_id = current_target_id
         private.harvesting = true
     end