Fix bug where Pico dadbattle was playing over normal dadbattle

This commit is contained in:
EliteMasterEric 2024-03-22 22:17:34 -04:00
parent a42524987e
commit 28088146eb
3 changed files with 14 additions and 4 deletions

2
assets

@ -1 +1 @@
Subproject commit 7cbe6ff4ed7d976e7c69d6677c4aa84988da0e8d Subproject commit 9a5767d04203a9cb9857608761646bb6a52b1e13

View file

@ -374,12 +374,17 @@ class Song implements IPlayStateScriptedClass implements IRegistryEntry<SongMeta
public function getFirstValidVariation(?diffId:String, ?possibleVariations:Array<String>):Null<String> public function getFirstValidVariation(?diffId:String, ?possibleVariations:Array<String>):Null<String>
{ {
if (variations == null) possibleVariations = variations; if (possibleVariations == null)
{
possibleVariations = variations;
possibleVariations.sort(SortUtil.defaultsThenAlphabetically.bind(Constants.DEFAULT_VARIATION_LIST));
}
if (diffId == null) diffId = listDifficulties(null, possibleVariations)[0]; if (diffId == null) diffId = listDifficulties(null, possibleVariations)[0];
for (variation in variations) for (variationId in possibleVariations)
{ {
if (difficulties.exists('$diffId-$variation')) return variation; var variationSuffix = (variationId != Constants.DEFAULT_VARIATION) ? '-$variationId' : '';
if (difficulties.exists('$diffId$variationSuffix')) return variationId;
} }
return null; return null;

View file

@ -157,6 +157,11 @@ class Constants
*/ */
public static final DEFAULT_VARIATION:String = 'default'; public static final DEFAULT_VARIATION:String = 'default';
/**
* Standard variations used by the game.
*/
public static final DEFAULT_VARIATION_LIST:Array<String> = ['default', 'erect', 'pico'];
/** /**
* The default intensity for camera zooms. * The default intensity for camera zooms.
*/ */