Skip to content

SoloParamRepository crash #299

Description

@ividyon

Minimal repro:

TestDll.zip

cs_task.run_recurring(
            // The registered task will be our closure.
            move |_t: &FD4TaskData| {
                if once {
                    return;
                }

                 let Ok(param_repo) = (unsafe { SoloParamRepository::instance_mut() })
                 else {
                     return;
                };
                
                let Some(_) = param_repo.get_mut::<EquipParamGoods>(190) else {
                     return;
                };

                once = true;
            },
            CSTaskGroupIndex::ChrIns_PostPhysics,
        );

This will panic:

2026-05-23T03:23:34.828180400+02:00 ERROR tracing_panic: A panic occurred panic.payload="Expected param holder to have exactly one res cap" panic.location="deps\\fromsoftware-rs\\crates\\eldenring\\src\\cs\\solo_param_repository.rs:490:14"

Reproduced when migrating from older FD4ParamRepository-based param fetching to SoloParamRepository in latest main. Returning to FD4ParamRepository and adding unsafe blocks where they weren't previously needed will work correctly as it did before.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions