[fixed] Bugs when spawning a music #2272
Open
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.
Status
Description
Fixes #1309
After this PR, you cannot spawn a
ctf_music
,music
,war_music
orchallenge_music
if one of these already exists.Fixes bugs that occur when multiple music blobs exist (music getting cut off over and over).
I removed
mixer.ResetMixer();
fromCTFMusic.as
onInit() because the other music scripts also don't have it and it is used inAddGameMusic(CBlob@ this, CMixer@ mixer)
already.Tested in offline and online, found no problems.
When a CTF match ends and the new map loads, music will correctly start playing again.
Alternative Solutions
This Pr might not be a good solution but I only aimed to fix the issue. There could be other possible solutions.
a) Replacing the existing music
It might be possible to write logic for replacing the existing music but it requires more time and research.
b) Blacklisting
Alternative to this PR would be to just put music blobs on the server's chat spawn command black list.
c) Is it possible to use a rules script instead of blob scripts?