Skip to content

Dynamic Dialogue: Infinite Loop When All Lance Pilots Dead During Rebinding #709

@CWolfs

Description

@CWolfs

RebindDeadUnitCastDef passes the bare bindKey (e.g. "TeamPilot_Random_1") to HandleFallback, but HandleFallback checks IsBindableRandomCastDefID which expects the castDef_ prefix. The guard always returns false on the rebinding path, so DynamicCastDefs is never updated to Darius and BoundAbstractActorsFullIndex retains the stale index.

This means LateBinding() re-binds the same dead actor, and the while (unit != null && unit.IsDead) loop in HandleDeadActorFromDialogueContent never terminates.

Reproducible without any other mods — trigger dialogue after all player lance pilots are dead or ejected in a contract using dynamic pilot cast defs (castDef_TeamPilot_Random_X).

Fix: wrap the argument with GetDynamicCastDefIDFromBindKey(bindKey) at the HandleFallback call site in RebindDeadUnitCastDef, matching what the adjacent BindCastDefAndActorIndex call already does.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions