diff options
author | rubidium <rubidium@openttd.org> | 2010-11-01 22:53:05 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2010-11-01 22:53:05 +0000 |
commit | 6d11c09ee66de9e2abab244368834c73bfef19a8 (patch) | |
tree | 3c352032948728eb1b88ed9a1348bbc5cb50151d | |
parent | 7148a8e21f82b92e67f7f854dca2db468d6c2d45 (diff) | |
download | openttd-6d11c09ee66de9e2abab244368834c73bfef19a8.tar.xz |
(svn r21075) -Fix [FS#4192]: Wrong (maximum) value shown for generation seed in the in-game console
-rw-r--r-- | src/settings.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/settings.cpp b/src/settings.cpp index d581059aa..e91f1cf69 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -1901,10 +1901,10 @@ void IConsoleGetSetting(const char *name, bool force_newgame) if (sd->desc.cmd == SDT_BOOLX) { snprintf(value, sizeof(value), (*(bool*)ptr == 1) ? "on" : "off"); } else { - snprintf(value, sizeof(value), "%d", (int32)ReadValue(ptr, sd->save.conv)); + snprintf(value, sizeof(value), sd->desc.min < 0 ? "%d" : "%u", (int32)ReadValue(ptr, sd->save.conv)); } - IConsolePrintF(CC_WARNING, "Current value for '%s' is: '%s' (min: %s%d, max: %d)", + IConsolePrintF(CC_WARNING, "Current value for '%s' is: '%s' (min: %s%d, max: %u)", name, value, (sd->desc.flags & SGF_0ISDISABLED) ? "(0) " : "", sd->desc.min, sd->desc.max); } } @@ -1929,7 +1929,7 @@ void IConsoleListSettings(const char *prefilter) } else if (sd->desc.cmd == SDT_STRING) { 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)); + snprintf(value, lengthof(value), sd->desc.min < 0 ? "%d" : "%u", (int32)ReadValue(ptr, sd->save.conv)); } IConsolePrintF(CC_DEFAULT, "%s = %s", sd->desc.name, value); } |