Improve CD key prevalidation - #880
Conversation
This is a bit mad really; it should just use |
|
Of course. I'll do tolower() in both though, I think it makes sense since the behaviour was 50/50 between those two files, Quake 3 keys were lowercase, and it fits better with the following. I had a look at Com_WriteCDKey: Lines 2531 to 2572 in 5d810e5 When the game boots up and when you press "Accept" on the CD key menu, the game reads & writes the key to the filesystem. If the key is upper/mixed-case then Com_WriteCDKey also writes it as upper/mixed-case. If we care, we can make it output only the valid Quake 3 lower-case version. Tell me if you'd like that added. The Steam version always overwrites the q3key in its game path with the uppercase version and reads it, so it doesn't really affect that. |
This issue is annoying since Steam provides an uppercase key. Similar commit in ioquake3: ioquake/ioq3@b75bee1 (ioquake/ioq3#880). The engine actually does a case-insensitive comparison: https://github.com/ec-/Quake3e/blob/ed1064f80fda9cde2e7d33c2d5dce8f8166b12bd/code/qcommon/common.c#L3113-L3140. I have tested this with the ioq3 engine. Quake3e seems to have a bug where it doesn't write the CD key file.
* Improve CD key prevalidation * Use tolower instead of ascii math
Fix #877
ioq3/code/client/cl_main.c
Lines 4720 to 4747 in 5d810e5
This snippet in cl_main.c already includes code to ignore case when validating CD key. The issue was that the UI_CDKeyMenu_PreValidateKey function diverged from this and prematurely failed.