KeyValues GetName returns wrong value
I use KeyValues to get data from configs.
Code:
"Config" Windows: "galil", "ak47", "m249", "hegrenade" Linux: "Galil", "AK47", "M249", "HEGrenade" How can I fix this? |
Re: KeyValues GetName returns wrong value
Well :-D I would say by lower casing the string, but that's not the right way to do so...
Also I had a problems with upper case in KeyValues, but only in file path and that the SM lower cased section names. Nothing like this... Just a little idea: Does it help to put section name in " ? Like: galil -> "galil" |
Re: KeyValues GetName returns wrong value
just make it lowercase? o__o
|
Re: KeyValues GetName returns wrong value
I'm not sure if you meant to post this in https://forums.alliedmods.net/forumdisplay.php?f=107, but if so I had a similar issue with keyvalues a few months ago. I just lowercased the string after reading it, but I'd be interested in seeing if theres a reason / fix.
|
Re: KeyValues GetName returns wrong value
KeyValue keys are case-insensitive, and get pooled internally - you can never rely on key casing matching your file.
|
Re: KeyValues GetName returns wrong value
KissLick, can't check your idea. Don't know why, but in the middle of the night (08/24/2015 - 03:43:31) something happend and GetName began to return correct strings
|
Re: KeyValues GetName returns wrong value
asherkin already explained why. You simply can't rely on KVs keys giving you consistent capitalization. The first string the KV system encounters is the string you'll get, regardless if other KV files have keys with differing capitalization.
|
All times are GMT -4. The time now is 00:17. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.