Fix: Creative/Survival/Menu Music Issues#1138
Open
tylerreese543-lab wants to merge 1 commit intosmartcmd:mainfrom
Open
Fix: Creative/Survival/Menu Music Issues#1138tylerreese543-lab wants to merge 1 commit intosmartcmd:mainfrom
tylerreese543-lab wants to merge 1 commit intosmartcmd:mainfrom
Conversation
|
Bro, please some improove your code, check my reference with Menu, Survival, Creative and other refactored code |
Author
|
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
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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