|
From: Vest <no...@gi...> - 2026-09-10 21:25:34
|
Branch: refs/heads/master Home: https://github.com/PCGen/pcgen Commit: ad5d173e6282a52b77d72e9c1d59ab5bd9345aeb https://github.com/PCGen/pcgen/commit/ad5d173e6282a52b77d72e9c1d59ab5bd9345aeb Author: Vest <Ve...@us...> Date: 2026-09-10 (Thu, 10 Sep 2026) Changed paths: M code/src/java/pcgen/cdom/formula/VariableUtilities.java M code/src/java/pcgen/gui2/facade/CharacterFacadeImpl.java M code/src/java/pcgen/io/PCGVer2Creator.java M code/src/java/pcgen/output/channel/ChannelUtilities.java A code/src/test/pcgen/output/channel/ChannelUtilitiesTest.java Log Message: ----------- fix: tolerate disabled Deity/Alignment channels in d20 Modern (#7734) Loading only MSRD (d20 Modern) and setting a race threw, and Save As cycled endlessly saving nothing. Modern sets ALIGNMENTFEATURE:NO and DOMAINFEATURE:NO in codeControl.lst (it has neither alignment nor deities/domains), so the CHANNEL*Alignment / CHANNEL*Deity variables are never asserted legal at load. Several paths read those channels unconditionally and threw IllegalArgumentException ("... not a legal variable"), breaking set-race (buildAvailableDomainsList) and every save (AlignmentCompat.getCurrentAlignment via PCGVer2Creator). Fix the low-level read so it tolerates a disabled/unregistered channel, covering all current and future callers rather than each call site: - ChannelUtilities.readGlobalChannel returns null when the channel variable is not legal (new VariableUtilities.isLegalGlobalVariable helper, reusing VariableContext.isLegalVariableID). - CharacterFacadeImpl.buildAvailableDomainsList early-returns when DOMAINFEATURE is disabled; its domain facades are only initialised under that feature and were otherwise null (NPE at updateContents). - PCGVer2Creator.appendAlignmentLine checks ALIGNMENTFEATURE before reading the channel (the guard previously ran after the throwing read). Adds ChannelUtilitiesTest covering a read of a disabled channel. Verified manually against Modern (set race + save now clean) and via the game_modern slowtests and io save-restore itests. To unsubscribe from these emails, change your notification settings at https://github.com/PCGen/pcgen/settings/notifications |