FunkinCrew / Funkin

A rhythm game made with HaxeFlixel
https://www.newgrounds.com/portal/view/770371
Other
2.95k stars 2.29k forks source link

Bug Report: Pico is unlocked immediately if you have a modded Playable Character. #3747

Open AbnormalPoof opened 5 days ago

AbnormalPoof commented 5 days ago

Issue Checklist

Platform

Itch.io (Downloadable Build) - MacOS

Browser

None

Version

v0.5.2

Description (include any images, videos, errors, or crash logs)

Using this mod: PLAYABLE MADOKA - A V-SLICE MOD as an example.

Notice how I don't have a score saved for WeekEnd 1: screenshot-2024-10-21-09-08-32

Yet the animation still shows on Freeplay: screenshot-2024-10-21-09-06-54

Entering the substate unlocks Pico immediately, along with the modded Playable Character: screenshot-2024-10-21-09-07-13

Now Pico is playable without me needing to beat WeekEnd 1: screenshot-2024-10-21-09-07-45

This also confuses mods that rely on Pico's isUnlocked() variable: screenshot-2024-10-21-09-16-13

Relevant code for reference:

    /**
     * Wether or not the character should be shown.
     * @param characterID The character ID we're using.
     * @return Bool
     */
    function shouldShowCharacter(characterID:String):Bool {
        if (PlayerRegistry.instance.isCharacterOwned(characterID)) {
            var ownerID:String = PlayerRegistry.instance.getCharacterOwnerId(characterID);
            var playableCharacter:PlayableCharacter = PlayerRegistry.instance.fetchEntry(ownerID);
            return playableCharacter != null && playableCharacter.isUnlocked();
        }
        return true;
    }

Steps to Reproduce

  1. Install a modded Playable Character.
  2. Pico is unlocked immediately.
JustKolosaki commented 5 days ago

I have a feeling this is due to some code in the CharacterSelectSubState since back when it was in the debug menu you could select pico, regardless if you have beaten weekend 1 or not. Selecting pico while he was still locked through the aforementioned trick caused some glitchy behaviour like no songs besides random being available until scrolling difficulties.

I'll give it a check for sure

Edit: I was right, the unlock characters function doesn't check if the character is available to be unlocked,,,,facepalm emoji,,,,,,

AbnormalPoof commented 5 days ago

Opened a PR which fixes this (#3748)

Average-FNF-Modder commented 1 day ago

Wait how do you get to that screen in the final image

AbnormalPoof commented 1 day ago

It's a mod

Average-FNF-Modder commented 1 day ago

It's a mod

Oh mb.