Skip to content

Commit a52e00e

Browse files
authored
Fix API
1 parent 847f0e1 commit a52e00e

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

Modules/API.lua

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -87,11 +87,12 @@ end
8787
BGFrame:SetScript("OnEvent", function(frame, event, ...)
8888
local map = eventMap[event]
8989
if not map then return end
90-
for k, v in pairs(map) do
90+
for k, v in pairs(map) do
91+
-- [FIX] Crash Shield: Use pcall to survive "Secret Value" errors in 12.0
9192
if type(v) == "function" then
92-
v(event, ...)
93+
pcall(v, event, ...)
9394
else
94-
k[v](k, event, ...)
95+
pcall(k[v], k, event, ...)
9596
end
9697
end
9798
end)
@@ -344,7 +345,7 @@ function API:Announce(zone)
344345
-- print("|cFF00FF00[PVPSound]|r Announce: " .. tostring(zone))
345346

346347
-- Queue Sound
347-
if zone == "BG" then
348+
if zone == "BG" or zone == "Wintergrasp" or zone == "Tol Barad" or zone == "Ashran" then
348349
if MyFaction == 1 then
349350
PVPSound:AddToQueue(PS.SoundPackDirectory .. "\\" .. PS_SoundPackLanguage .. "\\GameStatus\\PlayYouAreOnBlue.mp3")
350351
PVPSound:AddToSct("Blue Team", "You Are On Blue Team", "KILL")
@@ -360,7 +361,7 @@ end
360361
-- winner announcer
361362
-- type is BG or Arena
362363
function API:AnnounceWinner(zone, winner)
363-
if zone == "BG" then
364+
if zone == "BG" or zone == "Wintergrasp" or zone == "Tol Barad" or zone == "Ashran" then
364365
if winner == 0 then
365366
PVPSound:AddToQueue(PS.SoundPackDirectory.."\\"..PS_SoundPackLanguage.."\\GameStatus\\HordeWins.mp3")
366367
elseif winner == 1 then

0 commit comments

Comments
 (0)