# HG changeset patch # User James D. Callahan III # Date 1346426283 18000 # Node ID 6b118dd1baf4c46861add07954ee001708998dab # Parent f6369b88454fbb1563040e6aabd337fa8a33f671 Mark NPCs which generate reputation from being harvested as such (MoP crops). Remove reputation_npc_id as soon as it is no longer needed to prevent false-positives. diff -r f6369b88454f -r 6b118dd1baf4 Main.lua --- a/Main.lua Thu Aug 30 15:45:43 2012 -0500 +++ b/Main.lua Fri Aug 31 10:18:03 2012 -0500 @@ -508,8 +508,6 @@ end return text end - - end -- do-block @@ -733,6 +731,7 @@ if unit_type ~= private.UNIT_TYPES.NPC or not unit_idnum then reputation_npc_id = nil + private.harvesting = nil return end reputation_npc_id = unit_idnum @@ -825,10 +824,15 @@ return end local npc = NPCEntry(reputation_npc_id) + reputation_npc_id = nil if not npc then + private.harvesting = nil return end + npc.harvested = private.harvesting + private.harvesting = nil + local modifier = 1 if _G.IsSpellKnown(DIPLOMACY_SPELL_ID) then @@ -852,7 +856,6 @@ end npc.reputations = npc.reputations or {} npc.reputations[("%s:%s"):format(faction_name, faction_standings[faction_name])] = math.floor(amount / modifier) - reputation_npc_id = nil end end -- do-block @@ -1588,6 +1591,7 @@ if spell_name:match("^Harvest.+") then reputation_npc_id = current_target_id + private.harvesting = true end if anvil_spell_ids[spell_id] then