Skip to content

Commit ec7dfb0

Browse files
committed
Core: Test out not checking the map straight away
1 parent 567fbc7 commit ec7dfb0

File tree

4 files changed

+20
-156
lines changed

4 files changed

+20
-156
lines changed

Core.lua

Lines changed: 5 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -572,7 +572,6 @@ do
572572
}
573573
local atlasColors = nil
574574
local capTime = 0
575-
local curMapID = 0
576575
local curMod = nil
577576
local path = {136441}
578577
local GetIconData = function(icon)
@@ -584,8 +583,10 @@ do
584583
local GetAreaPOIInfo = C_AreaPoiInfo.GetAreaPOIInfo
585584
local GetAtlasInfo = C_Texture.GetAtlasInfo
586585
local GetSpellName = C_Spell.GetSpellName
586+
local GetBestMapForUnit = C_Map.GetBestMapForUnit
587587

588588
local function UpdatePOI()
589+
local curMapID = GetBestMapForUnit("player")
589590
local pois = GetAreaPOIForMap(curMapID)
590591
for i = 1, #pois do
591592
local tbl = GetAreaPOIInfo(curMapID, pois[i])
@@ -657,46 +658,11 @@ do
657658
end
658659
end
659660

660-
local GetBestMapForUnit = C_Map.GetBestMapForUnit
661661
function API:StartFlagCaptures(bgcaptime, _, colors)
662662
atlasColors = colors
663663
capTime = bgcaptime -- cap time
664-
curMapID = GetBestMapForUnit("player") -- current map
665664
landmarkCache = {}
666665
curMod = self
667-
local pois = GetAreaPOIForMap(curMapID)
668-
for i = 1, #pois do
669-
local tbl = GetAreaPOIInfo(curMapID, pois[i])
670-
local icon = tbl.textureIndex
671-
local atlasName = tbl.atlasName
672-
if icon then
673-
landmarkCache[tbl.name] = icon
674-
if icon == 2 or icon == 3 or icon == 151 or icon == 153 or icon == 18 or icon == 20 then
675-
-- Horde mine, Alliance mine, Alliance Refinery, Horde Refinery, Alliance Quarry, Horde Quarry
676-
local _, _, _, id = UnitPosition("player")
677-
if id == 30 or id == 628 or id == 2197 then -- Alterac Valley, IoC, Korrak's Revenge (WoW 15th)
678-
local bar = self:StartBar(tbl.name, 3600, GetIconData(icon), (icon == 3 or icon == 151 or icon == 18) and "colorAlliance" or "colorHorde", true) -- Paused bar for mine status
679-
bar:Pause()
680-
bar:SetTimeVisibility(false)
681-
bar:Set("capping:customchat", function() end)
682-
end
683-
end
684-
elseif atlasName then
685-
--local atlasTbl = GetAtlasInfo(atlasName)
686-
landmarkCache[tbl.name] = atlasName
687-
-- This can stay commented out until the day IoC/AV is converted to atlasNames
688-
--if atlasName == 2 or atlasName == 3 or atlasName == 151 or atlasName == 153 or atlasName == 18 or atlasName == 20 then
689-
-- -- Horde mine, Alliance mine, Alliance Refinery, Horde Refinery, Alliance Quarry, Horde Quarry
690-
-- local _, _, _, id = UnitPosition("player")
691-
-- if id == 30 or id == 628 then -- Alterac Valley, IoC
692-
-- local bar = self:StartBar(tbl.name, 3600, GetIconData(icon), (icon == 3 or icon == 151 or icon == 18) and "colorAlliance" or "colorHorde", true) -- Paused bar for mine status
693-
-- bar:Pause()
694-
-- bar:SetTimeVisibility(false)
695-
-- bar:Set("capping:customchat", function() end)
696-
-- end
697-
--end
698-
end
699-
end
700666
self:RegisterEvent("AREA_POIS_UPDATED", UpdatePOI)
701667
end
702668

@@ -867,11 +833,11 @@ do
867833
if zoneIds[id] then
868834
prevZone = id
869835
self:RegisterEvent("PLAYER_LEAVING_WORLD")
870-
self:Timer(0, function() zoneIds[id]:EnterZone(id) end)
871-
elseif instanceType == "arena" then
836+
zoneIds[id]:EnterZone(id)
837+
elseif zoneIds[instanceType] then
872838
prevZone = instanceType
873839
self:RegisterEvent("PLAYER_LEAVING_WORLD")
874-
self:Timer(0, function() zoneIds[instanceType]:EnterZone(id) end)
840+
zoneIds[instanceType]:EnterZone(id)
875841
end
876842
end
877843
function core:PLAYER_LEAVING_WORLD()

Core_BCC.lua

Lines changed: 5 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -647,7 +647,6 @@ do
647647
}
648648
local atlasColors = nil
649649
local capTime = 0
650-
local curMapID = 0
651650
local curMod = nil
652651
local path = {136441}
653652
local GetIconData = function(icon)
@@ -659,8 +658,10 @@ do
659658
local GetAreaPOIInfo = C_AreaPoiInfo.GetAreaPOIInfo
660659
local GetAtlasInfo = C_Texture.GetAtlasInfo
661660
local GetSpellName = C_Spell.GetSpellName
661+
local GetBestMapForUnit = C_Map.GetBestMapForUnit
662662

663663
local function UpdatePOI()
664+
local curMapID = GetBestMapForUnit("player")
664665
local pois = GetAreaPOIForMap(curMapID)
665666
for i = 1, #pois do
666667
local tbl = GetAreaPOIInfo(curMapID, pois[i])
@@ -732,46 +733,11 @@ do
732733
end
733734
end
734735

735-
local GetBestMapForUnit = C_Map.GetBestMapForUnit
736736
function API:StartFlagCaptures(bgcaptime, _, colors)
737737
atlasColors = colors
738738
capTime = bgcaptime -- cap time
739-
curMapID = GetBestMapForUnit("player") -- current map
740739
landmarkCache = {}
741740
curMod = self
742-
local pois = GetAreaPOIForMap(curMapID)
743-
for i = 1, #pois do
744-
local tbl = GetAreaPOIInfo(curMapID, pois[i])
745-
local icon = tbl.textureIndex
746-
local atlasName = tbl.atlasName
747-
if icon then
748-
landmarkCache[tbl.name] = icon
749-
if icon == 1 or icon == 2 then
750-
-- Horde mine, Alliance mine, Alliance Refinery, Horde Refinery, Alliance Quarry, Horde Quarry
751-
local _, _, _, id = UnitPosition("player")
752-
if id == 30 or id == 628 or id == 2197 then -- Alterac Valley, IoC, Korrak's Revenge (WoW 15th)
753-
local bar = self:StartBar(tbl.name, 3600, GetIconData(icon), icon == 2 and "colorAlliance" or "colorHorde", true) -- Paused bar for mine status
754-
bar:Pause()
755-
bar:SetTimeVisibility(false)
756-
bar:Set("capping:customchat", function() end)
757-
end
758-
end
759-
elseif atlasName then
760-
--local atlasTbl = GetAtlasInfo(atlasName)
761-
landmarkCache[tbl.name] = atlasName
762-
-- This can stay commented out until the day IoC/AV is converted to atlasNames
763-
--if atlasName == 2 or atlasName == 3 or atlasName == 151 or atlasName == 153 or atlasName == 18 or atlasName == 20 then
764-
-- -- Horde mine, Alliance mine, Alliance Refinery, Horde Refinery, Alliance Quarry, Horde Quarry
765-
-- local _, _, _, id = UnitPosition("player")
766-
-- if id == 30 or id == 628 then -- Alterac Valley, IoC
767-
-- local bar = self:StartBar(tbl.name, 3600, GetIconData(icon), (icon == 3 or icon == 151 or icon == 18) and "colorAlliance" or "colorHorde", true) -- Paused bar for mine status
768-
-- bar:Pause()
769-
-- bar:SetTimeVisibility(false)
770-
-- bar:Set("capping:customchat", function() end)
771-
-- end
772-
--end
773-
end
774-
end
775741
self:RegisterEvent("AREA_POIS_UPDATED", UpdatePOI)
776742
end
777743

@@ -923,11 +889,11 @@ do
923889
if zoneIds[id] then
924890
prevZone = id
925891
self:RegisterEvent("PLAYER_LEAVING_WORLD")
926-
self:Timer(0, function() zoneIds[id]:EnterZone(id) end)
927-
elseif instanceType == "arena" then
892+
zoneIds[id]:EnterZone(id)
893+
elseif zoneIds[instanceType] then
928894
prevZone = instanceType
929895
self:RegisterEvent("PLAYER_LEAVING_WORLD")
930-
self:Timer(0, function() zoneIds[instanceType]:EnterZone(id) end)
896+
zoneIds[instanceType]:EnterZone(id)
931897
end
932898
end
933899
function core:PLAYER_LEAVING_WORLD()

Core_Vanilla.lua

Lines changed: 5 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -647,7 +647,6 @@ do
647647
}
648648
local atlasColors = nil
649649
local capTime = 0
650-
local curMapID = 0
651650
local curMod = nil
652651
local path = {136441}
653652
local GetIconData = function(icon)
@@ -659,8 +658,10 @@ do
659658
local GetAreaPOIInfo = C_AreaPoiInfo.GetAreaPOIInfo
660659
local GetAtlasInfo = C_Texture.GetAtlasInfo
661660
--local GetSpellName = C_Spell.GetSpellName
661+
local GetBestMapForUnit = C_Map.GetBestMapForUnit
662662

663663
local function UpdatePOI()
664+
local curMapID = GetBestMapForUnit("player")
664665
local pois = GetAreaPOIForMap(curMapID)
665666
for i = 1, #pois do
666667
local tbl = GetAreaPOIInfo(curMapID, pois[i])
@@ -726,46 +727,11 @@ do
726727
end
727728
end
728729

729-
local GetBestMapForUnit = C_Map.GetBestMapForUnit
730730
function API:StartFlagCaptures(bgcaptime, _, colors)
731731
atlasColors = colors
732732
capTime = bgcaptime -- cap time
733-
curMapID = GetBestMapForUnit("player") -- current map
734733
landmarkCache = {}
735734
curMod = self
736-
local pois = GetAreaPOIForMap(curMapID)
737-
for i = 1, #pois do
738-
local tbl = GetAreaPOIInfo(curMapID, pois[i])
739-
local icon = tbl.textureIndex
740-
local atlasName = tbl.atlasName
741-
if icon then
742-
landmarkCache[tbl.name] = icon
743-
if icon == 1 or icon == 2 then
744-
-- Horde mine, Alliance mine
745-
local _, _, _, id = UnitPosition("player")
746-
if id == 30 then -- Alterac Valley
747-
local bar = self:StartBar(tbl.name, 3600, GetIconData(icon), icon == 2 and "colorAlliance" or "colorHorde", true) -- Paused bar for mine status
748-
bar:Pause()
749-
bar:SetTimeVisibility(false)
750-
bar:Set("capping:customchat", function() end)
751-
end
752-
end
753-
elseif atlasName then
754-
--local atlasTbl = GetAtlasInfo(atlasName)
755-
landmarkCache[tbl.name] = atlasName
756-
-- This can stay commented out until the day IoC/AV is converted to atlasNames
757-
--if atlasName == 2 or atlasName == 3 or atlasName == 151 or atlasName == 153 or atlasName == 18 or atlasName == 20 then
758-
-- -- Horde mine, Alliance mine, Alliance Refinery, Horde Refinery, Alliance Quarry, Horde Quarry
759-
-- local _, _, _, id = UnitPosition("player")
760-
-- if id == 30 or id == 628 then -- Alterac Valley, IoC
761-
-- local bar = self:StartBar(tbl.name, 3600, GetIconData(icon), (icon == 3 or icon == 151 or icon == 18) and "colorAlliance" or "colorHorde", true) -- Paused bar for mine status
762-
-- bar:Pause()
763-
-- bar:SetTimeVisibility(false)
764-
-- bar:Set("capping:customchat", function() end)
765-
-- end
766-
--end
767-
end
768-
end
769735
self:RegisterEvent("AREA_POIS_UPDATED", UpdatePOI)
770736
end
771737

@@ -917,11 +883,11 @@ do
917883
if zoneIds[id] then
918884
prevZone = id
919885
self:RegisterEvent("PLAYER_LEAVING_WORLD")
920-
self:Timer(0, function() zoneIds[id]:EnterZone(id) end)
921-
elseif instanceType == "arena" then
886+
zoneIds[id]:EnterZone(id)
887+
elseif zoneIds[instanceType] then
922888
prevZone = instanceType
923889
self:RegisterEvent("PLAYER_LEAVING_WORLD")
924-
self:Timer(0, function() zoneIds[instanceType]:EnterZone(id) end)
890+
zoneIds[instanceType]:EnterZone(id)
925891
end
926892
end
927893
function core:PLAYER_LEAVING_WORLD()

Core_Wrath.lua

Lines changed: 5 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -647,7 +647,6 @@ do
647647
}
648648
local atlasColors = nil
649649
local capTime = 0
650-
local curMapID = 0
651650
local curMod = nil
652651
local path = {136441}
653652
local GetIconData = function(icon)
@@ -659,8 +658,10 @@ do
659658
local GetAreaPOIInfo = C_AreaPoiInfo.GetAreaPOIInfo
660659
local GetAtlasInfo = C_Texture.GetAtlasInfo
661660
local GetSpellName = C_Spell.GetSpellName
661+
local GetBestMapForUnit = C_Map.GetBestMapForUnit
662662

663663
local function UpdatePOI()
664+
local curMapID = GetBestMapForUnit("player")
664665
local pois = GetAreaPOIForMap(curMapID)
665666
for i = 1, #pois do
666667
local tbl = GetAreaPOIInfo(curMapID, pois[i])
@@ -732,46 +733,11 @@ do
732733
end
733734
end
734735

735-
local GetBestMapForUnit = C_Map.GetBestMapForUnit
736736
function API:StartFlagCaptures(bgcaptime, _, colors)
737737
atlasColors = colors
738738
capTime = bgcaptime -- cap time
739-
curMapID = GetBestMapForUnit("player") -- current map
740739
landmarkCache = {}
741740
curMod = self
742-
local pois = GetAreaPOIForMap(curMapID)
743-
for i = 1, #pois do
744-
local tbl = GetAreaPOIInfo(curMapID, pois[i])
745-
local icon = tbl.textureIndex
746-
local atlasName = tbl.atlasName
747-
if icon then
748-
landmarkCache[tbl.name] = icon
749-
if icon == 2 or icon == 3 or icon == 151 or icon == 153 or icon == 18 or icon == 20 then
750-
-- Horde mine, Alliance mine, Alliance Refinery, Horde Refinery, Alliance Quarry, Horde Quarry
751-
local _, _, _, id = UnitPosition("player")
752-
if id == 30 or id == 628 or id == 2197 then -- Alterac Valley, IoC, Korrak's Revenge (WoW 15th)
753-
local bar = self:StartBar(tbl.name, 3600, GetIconData(icon), (icon == 3 or icon == 151 or icon == 18) and "colorAlliance" or "colorHorde", true) -- Paused bar for mine status
754-
bar:Pause()
755-
bar:SetTimeVisibility(false)
756-
bar:Set("capping:customchat", function() end)
757-
end
758-
end
759-
elseif atlasName then
760-
--local atlasTbl = GetAtlasInfo(atlasName)
761-
landmarkCache[tbl.name] = atlasName
762-
-- This can stay commented out until the day IoC/AV is converted to atlasNames
763-
--if atlasName == 2 or atlasName == 3 or atlasName == 151 or atlasName == 153 or atlasName == 18 or atlasName == 20 then
764-
-- -- Horde mine, Alliance mine, Alliance Refinery, Horde Refinery, Alliance Quarry, Horde Quarry
765-
-- local _, _, _, id = UnitPosition("player")
766-
-- if id == 30 or id == 628 then -- Alterac Valley, IoC
767-
-- local bar = self:StartBar(tbl.name, 3600, GetIconData(icon), (icon == 3 or icon == 151 or icon == 18) and "colorAlliance" or "colorHorde", true) -- Paused bar for mine status
768-
-- bar:Pause()
769-
-- bar:SetTimeVisibility(false)
770-
-- bar:Set("capping:customchat", function() end)
771-
-- end
772-
--end
773-
end
774-
end
775741
self:RegisterEvent("AREA_POIS_UPDATED", UpdatePOI)
776742
end
777743

@@ -923,11 +889,11 @@ do
923889
if zoneIds[id] then
924890
prevZone = id
925891
self:RegisterEvent("PLAYER_LEAVING_WORLD")
926-
self:Timer(0, function() zoneIds[id]:EnterZone(id) end)
927-
elseif instanceType == "arena" then
892+
zoneIds[id]:EnterZone(id)
893+
elseif zoneIds[instanceType] then
928894
prevZone = instanceType
929895
self:RegisterEvent("PLAYER_LEAVING_WORLD")
930-
self:Timer(0, function() zoneIds[instanceType]:EnterZone(id) end)
896+
zoneIds[instanceType]:EnterZone(id)
931897
end
932898
end
933899
function core:PLAYER_LEAVING_WORLD()

0 commit comments

Comments
 (0)