diff options
author | rubidium <rubidium@openttd.org> | 2010-05-20 15:12:48 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2010-05-20 15:12:48 +0000 |
commit | f1c1812e475d01233b59cf129b787d4bedf63996 (patch) | |
tree | da9fb06c2843d78ca47d14ef6e8ba616e2dd0b98 /src | |
parent | f994b11e8ca060c6a5b19389157d02cd86f34666 (diff) | |
download | openttd-f1c1812e475d01233b59cf129b787d4bedf63996.tar.xz |
(svn r19864) -Fix: don't print a pointer as string for listing (a) setting(s)
Diffstat (limited to 'src')
-rw-r--r-- | src/settings.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/settings.cpp b/src/settings.cpp index ae3e13c78..fffe35a9a 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -1828,7 +1828,7 @@ void IConsoleGetSetting(const char *name, bool force_newgame) ptr = GetVariableAddress((_game_mode == GM_MENU || force_newgame) ? &_settings_newgame : &_settings_game, &sd->save); if (sd->desc.cmd == SDT_STRING) { - IConsolePrintF(CC_WARNING, "Current value for '%s' is: '%s'", name, (const char *)ptr); + IConsolePrintF(CC_WARNING, "Current value for '%s' is: '%s'", name, (GetVarMemType(sd->save.conv) == SLE_VAR_STRQ) ? *(const char **)ptr : (const char *)ptr); } else { if (sd->desc.cmd == SDT_BOOLX) { snprintf(value, sizeof(value), (*(bool*)ptr == 1) ? "on" : "off"); @@ -1859,7 +1859,7 @@ void IConsoleListSettings(const char *prefilter) if (sd->desc.cmd == SDT_BOOLX) { snprintf(value, lengthof(value), (*(bool*)ptr == 1) ? "on" : "off"); } else if (sd->desc.cmd == SDT_STRING) { - snprintf(value, sizeof(value), "%s", (const char *)ptr); + snprintf(value, sizeof(value), "%s", (GetVarMemType(sd->save.conv) == SLE_VAR_STRQ) ? *(const char **)ptr : (const char *)ptr); } else { snprintf(value, lengthof(value), "%d", (uint32)ReadValue(ptr, sd->save.conv)); } |