Crash when turning off the last enabled sub-mod of a selected bundle

Aperta
#775 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 4 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
Mezza giornata
Idoneità per principianti
72/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
lua
Ambito
game-dev

Direzione di ricerca

Start at ModManagement.lua around the onValueChange handler (~line 252) and the character/stage toggle paths that call MatchParticipant:refreshDisabledSelections. Guard the last enabled sub-mod of a selected bundle the same way last visible character/stage is refused (#bundle:getSubMods() == 0), including re-enable of an all-off bundle. Confirm CharacterLoader.resolveBundle no longer indexes nil when the last sub-mod is turned off. Reproduce with a selected character bundle (e.g. Ash) in Options > Manage Mods.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Follow-up to #769 / #771.

Problem

With a character bundle selected, turning off every sub-mod of that bundle in Mod Management crashes the game on the last toggle.

With #771 applied, the crash happens on the toggle itself:

client/src/mods/CharacterLoader.lua:61: attempt to index a nil value
  CharacterLoader.resolveBundle
  MatchParticipant:refreshCharacter (MatchParticipant.lua:137)
  MatchParticipant:refreshDisabledSelections (MatchParticipant.lua:156)
  ModManagement.lua:252 onValueChange

Steps to reproduce

  1. Install a character bundle, e.g. Ash from the PPL pack (6 sub-mods).
  2. Select Ash as your character.
  3. Options > Manage Mods > characters: turn off Ash's sub-mods one at a time.
  4. Turning off the last enabled one crashes.

Suggested fix

Refuse the toggle when it would leave any enabled bundle with no enabled sub-mods (#bundle:getSubMods() == 0), the same way ModManagement already refuses turning off the last visible character or stage. Needed in both the character and stage handlers. Re-enabling a bundle whose sub-mods are all off needs the same check.

At startup ModLoader.disableBlacklisted already turns off a bundle whose sub-mods are all disabled, so this state can only be reached through Mod Management.

Lingua principale
Lua
Stelle
30
Fork
20
Merge medio
4g 19h
PR unite (30g)
14

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di panel-attack/panel-game

Tutte le issue di panel-attack/panel-game

Issue simili

Altre issue su Lua

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.