1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2025-12-23 15:52:55 +01:00

Move fallback name logic out of platform_get_username

This commit is contained in:
Alexander Overvoorde
2016-02-12 00:31:23 +01:00
parent 65f25f8340
commit 05c1aabc39
3 changed files with 9 additions and 5 deletions

View File

@@ -375,7 +375,13 @@ void config_set_defaults()
destValue->value_uint8 = platform_get_locale_temperature_format();
}
else if (strcmp(property->property_name, "player_name") == 0) {
destValue->value_string = _strdup(platform_get_username());
utf8* username = platform_get_username();
if (username) {
destValue->value_string = _strdup(username);
} else {
destValue->value_string = _strdup(language_get_string(STR_PLAYER_DEFAULT_NAME));
}
}
else {
// Use static default