BG3-Community-Library-Team / BG3-Compatibility-Framework

An API-based Driven Compatibility Framework for Baldur's Gate 3 Mods
MIT License
38 stars 13 forks source link

RemoveSelector removing 2 UUID instead of one #102

Open arnaudpourbaix opened 5 months ago

arnaudpourbaix commented 5 months ago

Calling Mods.SubclassCompatibilityFramework.Api.RemoveSelectors with:

{
        "FileType" : "Progression",
        "Function" : "AddSpells",
        "ListUUID" : "0f094e35-9675-464d-8cae-8e58c28de955",
        "TargetUUID" : "ac2a03fd-ac7b-42b6-a1b7-e0de94a77703",
        "modGuid" : "a5799115-ef11-457b-92cd-2c927de09b02"
}

Selectors value for this UUID: AddSpells(0f094e35-9675-464d-8cae-8e58c28de955,,,,AlwaysPrepared);AddSpells(e568eca4-b5e1-4b67-83d6-d831adf05e23,,,,AlwaysPrepared);AddSpells(729670a8-da85-4fd2-9764-4dec636a275b,DruidCircleOfTheSporesSpells,,,AlwaysPrepared)

Expected result: removes AddSpells(0f094e35-9675-464d-8cae-8e58c28de955 Result: removes AddSpells(0f094e35-9675-464d-8cae-8e58c28de955 and AddSpells(e568eca4-b5e1-4b67-83d6-d831adf05e23

So, it removes the next one too, but not the last one.

I have tried to debug RemoveSelector function, but it never enters for loop. Previous condition is false on Queue[Globals.ModuleTypes[type]][target].Selectors ~= nil

Queue[Globals.ModuleTypes[type]][target] value is:

{
        "Selectors_Remove" :
        {
                "AddSpells" :
                [
                        "0f094e35-9675-464d-8cae-8e58c28de955"
                ]
        }
}

I am using the latest version. And I have already used this API with success in the past.

RandoRuda commented 3 months ago

Sorry it has taken me a while to get around to looking at this, but ill health has really been impacting my capacity.

I know it's been more than a month, but I'll try and give this a bit of a test/investigation to see what's goin' on.

arnaudpourbaix commented 3 months ago

Take your time, your health is much more important. Currently, I'm just adding back what has been removed, so I have a working solution. It is just weird, I don't understand how it can go wrong.

RandoRuda commented 3 months ago

I know we had an issue similar to this in the past, so I hope it's as simple as I recall that one being.

As it is, removal has been a little bit of a pain.