comparison Main.lua @ 218:54e268151cd2

Removed code dealing with blacklisted battleground maps.
author James D. Callahan III <jcallahan@curse.com>
date Thu, 24 Jan 2013 13:15:30 -0600
parents 719fe69d3af2
children 09d8ee2c1551
comparison
equal deleted inserted replaced
217:719fe69d3af2 218:54e268151cd2
423 return unit_type 423 return unit_type
424 end 424 end
425 end -- do-block 425 end -- do-block
426 426
427 427
428 local function UpdateBlacklistMaps()
429 local empty_count = 0
430
431 for index = 1, _G.MAX_BLACKLIST_BATTLEGROUNDS do
432 local map_id = _G.GetBlacklistMap(index)
433 char_db.bg_blacklist = char_db.bg_blacklist or {}
434 char_db.bg_blacklist[index] = map_id
435
436 if map_id < 0 then
437 empty_count = empty_count + 1
438 empty_count = empty_count + 1
439 end
440 end
441
442 if empty_count == _G.MAX_BLACKLIST_BATTLEGROUNDS then
443 char_db.bg_blacklist = nil
444 end
445 end
446
447
448 local UpdateDBEntryLocation 428 local UpdateDBEntryLocation
449 do 429 do
450 local pi = math.pi 430 local pi = math.pi
451 431
452 -- Fishing node coordinate code based on code in GatherMate2 with permission from Kagaro. 432 -- Fishing node coordinate code based on code in GatherMate2 with permission from Kagaro.
815 end 795 end
816 local _, item_link = _G.GetItemInfo(identifier) 796 local _, item_link = _G.GetItemInfo(identifier)
817 HandleItemUse(item_link) 797 HandleItemUse(item_link)
818 end) 798 end)
819 self:SetCurrentAreaID("OnEnable") 799 self:SetCurrentAreaID("OnEnable")
820
821 _G.hooksecurefunc("SetBlacklistMap", UpdateBlacklistMaps)
822 _G.hooksecurefunc("ClearBlacklistMap", UpdateBlacklistMaps)
823
824 UpdateBlacklistMaps()
825 end 800 end
826 801
827 802
828 local function RecordItemData(item_id, item_link, durability) 803 local function RecordItemData(item_id, item_link, durability)
829 local item = DBEntry("items", item_id) 804 local item = DBEntry("items", item_id)