build_avatar_badges() renames the first Appearance sprite for each player, but unconditionally writes its new name into StateManager.stateConfigs[0].
On main at 1b4239b54303ed593e2335c219f453300b5885dd, a prefab with states:
[{'state': 'waiting'}, {'state': 'badge', 'sprite': 'Badge'}]
produces:
[{'state': 'waiting', 'sprite': 'Badge1'},
{'state': 'badge', 'sprite': 'Badge'}]
Appearance now defines Badge1, leaving the visible state's Badge reference unresolved and adding a sprite to a state that originally had none. Additional states using that sprite also retain its old name. An unrelated sprite in the first state is overwritten.
The avatar builder already updates every state referring to the renamed sprite. Applying that matching-reference logic to badges preserves state ordering, states without sprites and other sprite references.
Sixteen regression/control cases use actual prefab dictionaries and the public badge/game-object builders. They cover visible states before/after waiting states, multiple matching states, unrelated sprites, one/three players, unchanged input prefabs and independent generated objects. Original code fails nine and passes seven controls; the correction passes all sixteen. This validates configuration building, without claiming rendered-gameplay verification.
This is separate from palette-count validation (#356) and palette annotations (#416). A focused PR is being prepared.
build_avatar_badges()renames the first Appearance sprite for each player, but unconditionally writes its new name intoStateManager.stateConfigs[0].On main at
1b4239b54303ed593e2335c219f453300b5885dd, a prefab with states:[{'state': 'waiting'}, {'state': 'badge', 'sprite': 'Badge'}]produces:
[{'state': 'waiting', 'sprite': 'Badge1'}, {'state': 'badge', 'sprite': 'Badge'}]Appearance now defines
Badge1, leaving the visible state'sBadgereference unresolved and adding a sprite to a state that originally had none. Additional states using that sprite also retain its old name. An unrelated sprite in the first state is overwritten.The avatar builder already updates every state referring to the renamed sprite. Applying that matching-reference logic to badges preserves state ordering, states without sprites and other sprite references.
Sixteen regression/control cases use actual prefab dictionaries and the public badge/game-object builders. They cover visible states before/after waiting states, multiple matching states, unrelated sprites, one/three players, unchanged input prefabs and independent generated objects. Original code fails nine and passes seven controls; the correction passes all sixteen. This validates configuration building, without claiming rendered-gameplay verification.
This is separate from palette-count validation (#356) and palette annotations (#416). A focused PR is being prepared.