Skip to content

Commit

Permalink
Fix a bug where the completion sound would play too frequently
Browse files Browse the repository at this point in the history
  • Loading branch information
azuraji committed Mar 5, 2023
1 parent 2613363 commit ca170f4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 13 deletions.
18 changes: 7 additions & 11 deletions MonkeyQuest/MonkeyQuest.lua
Original file line number Diff line number Diff line change
Expand Up @@ -547,11 +547,7 @@ function MonkeyQuest_Refresh()

if (strLeaderBoardText) then
if (not iFinished) then
if (MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bColourSubObjectivesByProgress == true) then
strMonkeyQuestBody = strMonkeyQuestBody .. " " .. MonkeyQuest_GetLeaderboardColorStr(strLeaderBoardText) .. strLeaderBoardText .. "\n";
else
strMonkeyQuestBody = strMonkeyQuestBody .. " " .. MonkeyQuest_GetLeaderboardColorStr(strLeaderBoardText) .. strLeaderBoardText .. "\n";
end
strMonkeyQuestBody = strMonkeyQuestBody .. " " .. MonkeyQuest_GetLeaderboardColorStr(strLeaderBoardText) .. strLeaderBoardText .. "\n";
elseif (MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bHideCompletedObjectives == false
or MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bShowHidden) then
strMonkeyQuestBody = strMonkeyQuestBody .. " " ..
Expand Down Expand Up @@ -579,11 +575,11 @@ function MonkeyQuest_Refresh()
MonkeyQuestObjectiveTable[currentObjectiveName] = {};
end

if (isComplete and (MonkeyQuestObjectiveTable[currentObjectiveName].complete == nil or MonkeyQuestObjectiveTable[currentObjectiveName].complete == false)) then
if (isComplete and objectiveComplete and MonkeyQuestObjectiveTable[currentObjectiveName] and MonkeyQuestObjectiveTable[currentObjectiveName].complete == nil) then
PlaySoundFile(569169) -- sound/spells/valentines_lookingforloveheart.ogg
end

MonkeyQuestObjectiveTable[currentObjectiveName].complete = objectiveComplete;
MonkeyQuestObjectiveTable[currentObjectiveName].complete = objectiveComplete;
end
end
elseif (objectiveType == "event") then
if (objectiveDesc ~= nil) then
Expand All @@ -594,12 +590,12 @@ function MonkeyQuest_Refresh()
MonkeyQuestObjectiveTable[currentObjectiveDesc] = {};
end

if (objectiveComplete == true and MonkeyQuestObjectiveTable[currentObjectiveDesc].complete == nil) then
if (isComplete and objectiveComplete and MonkeyQuestObjectiveTable[currentObjectiveName] and MonkeyQuestObjectiveTable[currentObjectiveName].complete == nil) then
-- PlaySoundFile("sound\\spells\\valentines_lookingforloveheart.ogg")
PlaySoundFile(569169)
end

MonkeyQuestObjectiveTable[currentObjectiveDesc].complete = objectiveComplete;
MonkeyQuestObjectiveTable[currentObjectiveDesc].complete = objectiveComplete;
end
end
end
end
Expand Down
4 changes: 2 additions & 2 deletions MonkeyQuest/MonkeyQuest.toc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
## Interface: 100002
## Title: MonkeyQuest v10.0.2.5
## Interface: 100005
## Title: MonkeyQuest v10.0.5.0
## Notes: Displays your quests for quick viewing. (http://www.toctastic.net/)
## Notes-deDE: Stellt Quests in einer kompakten Uebersicht dar. (http://www.toctastic.net/)
## Author: Trentin, Jim-Bim, azuraji
Expand Down

0 comments on commit ca170f4

Please sign in to comment.