Skip to content

Commit 23c84f6

Browse files
committed
fix(menus): Environment Sound
1 parent c17e3c0 commit 23c84f6

File tree

7 files changed

+19532
-11167
lines changed

7 files changed

+19532
-11167
lines changed

plugin_files/gamedata/signatures.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,11 @@
139139
"windows": "48 8B C4 48 89 58 10 48 89 70 18 55 57 41 56 48 8D A8 08 FF FF FF",
140140
"linux": "48 B8 2A 2A 2A 2A 2A 2A 2A 2A 55 48 89 E5 41 55 41 54 49 89 FC 53 48 89 F3"
141141
},
142+
"CBaseEntity_EmitSoundFilter": {
143+
"lib": "server",
144+
"windows": "48 89 5C 24 08 48 89 6C 24 10 48 89 74 24 18 48 89 7C 24 20 41 56 48 83 EC 30 48 8B EA",
145+
"linux": "55 48 89 E5 41 56 49 89 D6 41 55 41 89 F5 41 54 48 8D 35 2A 2A 2A 2A"
146+
},
142147
"LoggingSystem_Log": {
143148
"lib": "tier0",
144149
"windows": "@LoggingSystem_Log",

src/player/Player.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -475,8 +475,9 @@ void Player::PerformMenuAction(std::string button)
475475
if (button == g_Config->FetchValue<std::string>("core.menu.buttons.scroll"))
476476
{
477477
CCSPlayerController *controller = this->GetPlayerController();
478+
CSingleRecipientFilter filter(this->GetSlot().Get());
478479
if (controller)
479-
controller->EmitSound(g_Config->FetchValue<std::string>("core.menu.sound.name"), 100, g_Config->FetchValue<double>("core.menu.sound.volume"), 0);
480+
controller->EmitSoundFilter(filter, g_Config->FetchValue<std::string>("core.menu.sound.name"), 1.0, g_Config->FetchValue<double>("core.menu.sound.volume"));
480481

481482
this->MoveSelection();
482483
this->RenderMenu();
@@ -488,8 +489,9 @@ void Player::PerformMenuAction(std::string button)
488489
else if (button == g_Config->FetchValue<std::string>("core.menu.buttons.use"))
489490
{
490491
CCSPlayerController *controller = this->GetPlayerController();
492+
CSingleRecipientFilter filter(this->GetSlot().Get());
491493
if (controller)
492-
controller->EmitSound(g_Config->FetchValue<std::string>("core.menu.sound.name"), 100, g_Config->FetchValue<double>("core.menu.sound.volume"), 0);
494+
controller->EmitSoundFilter(filter, g_Config->FetchValue<std::string>("core.menu.sound.name"), 1.0, g_Config->FetchValue<double>("core.menu.sound.volume"));
493495

494496
std::string cmd = this->GetMenu()->GetCommandFromOption(this->GetPage(), this->GetSelection());
495497
if (cmd == "menunext")

0 commit comments

Comments
 (0)