Advanced Search

Author Topic: [Minor] Small music script bug  (Read 1154 times)

0 Members and 1 Guest are viewing this topic.

November 11, 2017, 06:06:23 PM
Read 1154 times

Offline Messatsu

  • MM8BDM Extender

  • ....

  • *****
  • Date Registered: November 10, 2010, 04:06:39 PM

    • View Profile
[Minor] Small music script bug
« 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.

November 11, 2017, 10:31:22 PM
Reply #1

Offline CutmanMike

  • Administrator

  • :dozercool:

  • ******
  • Date Registered: December 17, 2008, 12:24:34 PM

    • View Profile
    • http://cutstuff.net
Re: [Minor] Small music script bug
« Reply #1 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.

November 12, 2017, 01:06:10 AM
Reply #2

Offline Messatsu

  • MM8BDM Extender

  • ....

  • *****
  • Date Registered: November 10, 2010, 04:06:39 PM

    • View Profile
Re: [Minor] Small music script bug
« Reply #2 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.