Repository navigation
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
When selecting Capture The Flag (or other non-FFA gametypes) in the Solo Game / Create Server menu using stock BaseJKA
ui/jamp/createserver.menu, the End Game Rules section displays Duel Limit instead of Capture Limit.Why this happens:
createserver.menucontrols visibility ofScore Limit,Duel Limit, andCapture LimitusingcvarTest "ui_netGameType"tested against BaseJKA's 0..5 menu index (0 = FFA,1 = Duel,2 = Power Duel,3 = Team FFA,4 = Siege,5 = CTF).gametype_eenum directly inui_netGameType(0 = GT_FFA,1 = GT_HOLOCRON,2 = GT_JEDIMASTER,3 = GT_DUEL,4 = GT_POWERDUEL,6 = GT_TEAM,7 = GT_SIEGE,8 = GT_CTF,9 = GT_CTY).GT_CTF(8) does not equal"5",createserver.menu'sshowCvar/hideCvarexpressions evaluate the wrong branch and showDuel Limit.Fix
UI_NormalizeMenuCvarTestValue()inui/ui_shared.cpp, called fromItem_EnableShowViaCvar()andItem_EnableShowViaCvar2(), which mapsui_netGameTyperawgametype_evalues (0..9) to BaseJKA's expected0..5index solely when evaluating menucvarTestrules (without changing the stored value ofui_netGameTypeitself).ui_actualNetGametypeinui/ui_xcvar.hand keep it synced withui_netGameTypeinui/ui_main.cppfor menu scripts that reference it.Verification
Verified in Solo Game / Create Server across FFA, Duel, Power Duel, Team FFA, Siege, and CTF: CTF/CTY now display Capture Limit, Duel/Power Duel display Duel Limit, and FFA/Team FFA display Score Limit.