ppy / osu

rhythm is just a *click* away!
https://osu.ppy.sh
MIT License
15.49k stars 2.3k forks source link

Leaving a multiplayer lobby now plays the "host leaving" sound #30665

Open diediediebitch opened 1 week ago

diediediebitch commented 1 week ago

Type

Game behaviour

Bug description

When you leave a multiplayer lobby it will play the sound of the host in your lobby leaving as well as the original leave game sound

I'm assuming this isn't intended and I checked the changelog and it wasn't mentioned

Screenshots or videos

No response

Version

2024.1115.2

Logs

compressed-logs.zip

peppy commented 1 week ago

@smoogipoo likely one for you

smoogipoo commented 1 week ago

The fix appears to be something along the lines of:

diff --git a/osu.Game/Screens/OnlinePlay/Multiplayer/MultiplayerRoomSounds.cs b/osu.Game/Screens/OnlinePlay/Multiplayer/MultiplayerRoomSounds.cs
index d53e485c86..5da6e0a19d 100644
--- a/osu.Game/Screens/OnlinePlay/Multiplayer/MultiplayerRoomSounds.cs
+++ b/osu.Game/Screens/OnlinePlay/Multiplayer/MultiplayerRoomSounds.cs
@@ -50,7 +50,7 @@ private void updateState()
                 return;

             // only play sound when the host changes from an already-existing host.
-            if (host != null)
+            if (host != null && client.Room?.Host != null)
                 Scheduler.AddOnce(() => hostChangedSample?.Play());

             host = client.Room?.Host;

Though I'm not sure about committing this now or after https://github.com/ppy/osu/pull/30634 .