Skip to content

Commit 3c22d86

Browse files
committed
fix(player): two sound will played of exit menu
1 parent f542a63 commit 3c22d86

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/player/Player.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -494,12 +494,11 @@ void Player::PerformMenuAction(std::string button)
494494
}
495495
else if (button == g_Config->FetchValue<std::string>("core.menu.buttons.use"))
496496
{
497+
std::string cmd = this->GetMenu()->GetCommandFromOption(this->GetPage(), this->GetSelection());
497498
CCSPlayerController* controller = this->GetPlayerController();
498499
CSingleRecipientFilter filter(this->GetSlot().Get());
499-
if (controller)
500+
if (controller && cmd != "menuexit")
500501
controller->EmitSoundFilter(filter, g_Config->FetchValue<std::string>("core.menu.sound.use.name"), 1.0, g_Config->FetchValue<double>("core.menu.sound.use.volume"));
501-
502-
std::string cmd = this->GetMenu()->GetCommandFromOption(this->GetPage(), this->GetSelection());
503502
if (cmd == "menunext")
504503
{
505504
this->SetPage(this->GetPage() + 1);

0 commit comments

Comments
 (0)