Skip to content

Fix: Creative/Survival/Menu Music Issues#1138

Open
tylerreese543-lab wants to merge 1 commit intosmartcmd:mainfrom
tylerreese543-lab:menu-music-fix
Open

Fix: Creative/Survival/Menu Music Issues#1138
tylerreese543-lab wants to merge 1 commit intosmartcmd:mainfrom
tylerreese543-lab:menu-music-fix

Conversation

@tylerreese543-lab
Copy link

Description

Separation from previous closed PR #1090

Separates music properly and prevents music from the wrong gamemode/state playing.

Changes

Previous Behavior

Sometimes the incorrect songs would play as there was no differentiation of the game's states (eg survival songs might play in the menu, and menu songs might play in creative mode).

Root Cause

This was because 1. The "piano3" enumerator that the SoundEngine uses came AFTER all of the creative/menu songs, so they were included in the range of songs available to play.

New Behavior

Now the code queries the state of the game and the gamemode of the primary player to determine music properly.

Fix Implementation

Added two new [int] ranges for creative and menu music
*, **Updated the SoundEngine::SetStreamingSounds to have arguments for these two ranges
Queried the player's gamemode to differentiate between creative and survival music
All other music defaults to the menu music if no player is present.

*Mash-up packs don't differentiate between these two ranges, so they are identical in the DLCTexturePack.cpp file.
**Defaulted to Creative1-6, Menu1-4.

AI Use Disclosure

No AI was used 🫡

Related Issues

@tylerreese543-lab tylerreese543-lab changed the title Fix Fix: Fixed wrong background music playing Mar 11, 2026
@tylerreese543-lab tylerreese543-lab changed the title Fix: Fixed wrong background music playing Fix: Creative/Survival/Menu Music Issues Mar 11, 2026
@NSDeathman
Copy link

Bro, please some improove your code, check my reference with Menu, Survival, Creative and other refactored code

NSDeathman@dca3bf2

@tylerreese543-lab
Copy link
Author

tylerreese543-lab commented Mar 11, 2026

I'm all for re-factoring but this seems over-engineered.

Even when mash-up packs are added you just plug the new ranges into SetStreamingSounds

  • when mini-games are added you can do the same thing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants