Mercurial > wow > wowdb-profiler
comparison Main.lua @ 401:2fa787786d9a
Added loot verification functions for NPCs and objects to prevent fishing data from being misrecorded.
author | MMOSimca <MMOSimca@gmail.com> |
---|---|
date | Sun, 21 Dec 2014 22:43:43 -0500 |
parents | eb64f3b68a27 |
children | da1daa941777 |
comparison
equal
deleted
inserted
replaced
400:eb64f3b68a27 | 401:2fa787786d9a |
---|---|
1945 return false | 1945 return false |
1946 end | 1946 end |
1947 current_action.identifier = locked_item_id | 1947 current_action.identifier = locked_item_id |
1948 return true | 1948 return true |
1949 end, | 1949 end, |
1950 [AF.NPC] = true, | 1950 [AF.NPC] = function() |
1951 [AF.OBJECT] = true, | 1951 return not _G.IsFishingLoot() |
1952 end, | |
1953 [AF.OBJECT] = function() | |
1954 return not _G.IsFishingLoot() | |
1955 end, | |
1952 [AF.ZONE] = function() | 1956 [AF.ZONE] = function() |
1953 current_action.zone_data = UpdateDBEntryLocation("zones", current_action.identifier) | 1957 current_action.zone_data = UpdateDBEntryLocation("zones", current_action.identifier) |
1954 return _G.IsFishingLoot() | 1958 return _G.IsFishingLoot() |
1955 end, | 1959 end, |
1956 } | 1960 } |
2129 if (num_npcs > 0 and num_objects + num_itemcontainers > 0) or (num_objects > 0 and num_npcs + num_itemcontainers > 0) or (num_itemcontainers > 0 and num_npcs + num_objects > 0) then | 2133 if (num_npcs > 0 and num_objects + num_itemcontainers > 0) or (num_objects > 0 and num_npcs + num_itemcontainers > 0) or (num_itemcontainers > 0 and num_npcs + num_objects > 0) then |
2130 Debug("%s: Mixed target types are not supported. NPCs - %d, Objects - %d, Item Containers - %d.", log_source, num_npcs, num_objects, num_itemcontainers) | 2134 Debug("%s: Mixed target types are not supported. NPCs - %d, Objects - %d, Item Containers - %d.", log_source, num_npcs, num_objects, num_itemcontainers) |
2131 return false | 2135 return false |
2132 end | 2136 end |
2133 | 2137 |
2134 Debug("%s: Successfully extrapolated information for current_action.", log_source) | |
2135 return true | 2138 return true |
2136 end | 2139 end |
2137 | 2140 |
2138 | 2141 |
2139 function WDP:LOOT_OPENED(event_name) | 2142 function WDP:LOOT_OPENED(event_name) |
2148 return | 2151 return |
2149 end | 2152 end |
2150 end | 2153 end |
2151 | 2154 |
2152 if not current_action.target_type then | 2155 if not current_action.target_type then |
2153 Debug("%s: No target type found. Attempting to extrapolate current_action from loot data.", event_name) | |
2154 | |
2155 if not ExtrapolatedCurrentActionFromLootData(event_name) then | 2156 if not ExtrapolatedCurrentActionFromLootData(event_name) then |
2156 Debug("%s: Unable to extrapolate current_action. Aborting attempts to handle loot for now.", event_name) | 2157 Debug("%s: Unable to extrapolate current_action. Aborting attempts to handle loot for now.", event_name) |
2157 return | 2158 return |
2158 end | 2159 end |
2159 end | 2160 end |