Is it possible to check that a preference exists before getting it? Obviously you need to PutPreference before GetPreference will get anything meaningful. This is an issue mostly for string preferences where it seems that GetStringPreference returns a load of nonsense when the preference it's trying to get doesn't exist. If it's not possible to check, is there a way of specifying a default value for it to return?
I also noticed that if you use a boolean preference and initialise the AIBoolean to 0 (false), it seems to always become 1 (true) after the call to GetBooleanPreference if the preference doesn't exist.
What is the return value from the function calls? Should probably be non zero if the preference doesn't exist.
The function returns 0, which does seem a little daft.
I have now realised I was incorrect and that you can actually provide defaults. If you initialize a variable with a default value prior to passing it to a function to return the preference, the value doesn't change if the preference doesn't exist.