From aa251af11684e7e4450363abe7e2a32fc1bbfef9 Mon Sep 17 00:00:00 2001 From: AbnormalPoof Date: Sat, 31 Jan 2026 21:51:43 -0600 Subject: [PATCH] Fix Boyfriend (Christmas) being default Boyfriend --- assets | 2 +- .../play/character/MultiSparrowCharacter.hx | 25 ++++++++++++++++++- 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/assets b/assets index 275edb750..ee1c843f6 160000 --- a/assets +++ b/assets @@ -1 +1 @@ -Subproject commit 275edb7500c16db529f3cb52c44ac3a71daeec34 +Subproject commit ee1c843f67afeda7e2b1f948fdcccaaea2e2ac77 diff --git a/source/funkin/play/character/MultiSparrowCharacter.hx b/source/funkin/play/character/MultiSparrowCharacter.hx index b7bafbb3e..073cc33b5 100644 --- a/source/funkin/play/character/MultiSparrowCharacter.hx +++ b/source/funkin/play/character/MultiSparrowCharacter.hx @@ -21,6 +21,8 @@ import funkin.data.character.CharacterData.CharacterRenderType; */ class MultiSparrowCharacter extends BaseCharacter { + var _usedAtlases:Array = []; + public function new(id:String) { super(id, CharacterRenderType.MultiSparrow); @@ -72,7 +74,6 @@ class MultiSparrowCharacter extends BaseCharacter { log('Creating multi-sparrow atlas: ${_data.assetPath}'); mainTexture.parent.destroyOnNoUse = false; - textureList.push(mainTexture); } var hasTextureAtlas:Bool = false; @@ -104,6 +105,8 @@ class MultiSparrowCharacter extends BaseCharacter subTexture.parent.destroyOnNoUse = false; textureList.push(subTexture); + + if (!_usedAtlases.contains(subTexture)) _usedAtlases.push(subTexture); default: var subTexture:FlxAtlasFrames = Paths.getSparrowAtlas(animation.assetPath); // If we don't do this, the unused textures will be removed as soon as they're loaded. @@ -130,11 +133,18 @@ class MultiSparrowCharacter extends BaseCharacter } textureList.push(subTexture); + + if (!_usedAtlases.contains(subTexture)) _usedAtlases.push(subTexture); } addedAssetPaths.push(animation.assetPath); } + // Finally, add the main texture to the list + // Prevents sub-textures from overriding the the frames of the main texture + textureList.push(mainTexture); + _usedAtlases.push(mainTexture); + this.frames = FlxAnimateFrames.combineAtlas(textureList); this.setScale(_data.scale); } @@ -172,4 +182,17 @@ class MultiSparrowCharacter extends BaseCharacter { trace(' MULTIATLASCHAR '.bold().bg_blue() + ' $message'); } + + override function destroy():Void + { + for (atlas in _usedAtlases) + { + if (atlas.parent == null) continue; + atlas.parent.destroyOnNoUse = true; + } + + _usedAtlases.clear(); + + super.destroy(); + } }