Cutstuff Forum

Mega Man 8-bit Deathmatch => Bugs/Suggestions => MM8BDM Discussion => Closed => Topic started by: Messatsu on November 11, 2017, 06:06:23 PM

Title: [Minor] Small music script bug
Post by: Messatsu on November 11, 2017, 06:06:23 PM
This one is kinda small and obscure, but it's worth noting.

The cvars used for boss music (ex.mm8bdm_map_bossmusic) aren't cleared when you do a "map" change.  (changemap and nextmap are fine)  As a result, with some maps that don't have this cvar defined but use PAR to specify the boss music, it's possible it will play the boss music from the previous map instead due to how the script works.

To replicate the bug, choose any map from the core that uses the cvars, then MAP to something from a map pack that doesn't have it's own boss music script. (CTF packs for example) and play till the boss music would trigger.
Title: Re: [Minor] Small music script bug
Post by: CutmanMike on November 11, 2017, 10:31:22 PM
Yeah I couldn't think of a clean way to fix this. UNLOADING doesn't get triggered by the map command unfortunately.
Title: Re: [Minor] Small music script bug
Post by: Messatsu on November 12, 2017, 01:06:10 AM
The only way I can think to do it is do null the variables before the rest of the script runs.  Granted that would require scripts in the CTF maps to delay.  I dunno, if anything better springs to mind I'll post it.

Edit: Actually, side thought.  Why even use PAR at all at this point in the music script? You could partially fix this by just having PAR specify the cvar and never explicitly call the PAR.  Doesn't really help with maps that use custom music, but it'd be a step.