summaryrefslogtreecommitdiff
path: root/src/ai
diff options
context:
space:
mode:
authoryexo <yexo@openttd.org>2009-03-24 20:03:02 +0000
committeryexo <yexo@openttd.org>2009-03-24 20:03:02 +0000
commit84fb615344af1d998ae607aea7801d74a3b90e4e (patch)
tree70b7dee14892374c8be6116a56e3cddf0ec43b54 /src/ai
parent306239ee3e8376c1c85e80e5b7960e0ba488ad32 (diff)
downloadopenttd-84fb615344af1d998ae607aea7801d74a3b90e4e.tar.xz
(svn r15835) -Codechange: Prevent using the return value of DrawString as much as possible.
Diffstat (limited to 'src/ai')
-rw-r--r--src/ai/ai_gui.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/ai/ai_gui.cpp b/src/ai/ai_gui.cpp
index 1aca40af8..c8f88eaa8 100644
--- a/src/ai/ai_gui.cpp
+++ b/src/ai/ai_gui.cpp
@@ -95,13 +95,11 @@ struct AIListWindow : public Window {
/* Some info about the currently selected AI. */
if (selected_info != NULL) {
int y = this->widget[AIL_WIDGET_INFO_BG].top + 6;
- int x = DrawString(this->widget[AIL_WIDGET_LIST].left + 4, this->widget[AIL_WIDGET_LIST].right - 4, y, STR_AI_AUTHOR, TC_BLACK);
- DrawString(x + 5, this->widget[AIL_WIDGET_LIST].right - 4, y, selected_info->GetAuthor(), TC_BLACK);
+ SetDParamStr(0, selected_info->GetAuthor());
+ DrawString(4, this->widget[AIL_WIDGET_INFO_BG].right - 4, y, STR_AI_AUTHOR, TC_BLACK);
y += 13;
- x = DrawString(this->widget[AIL_WIDGET_LIST].left + 4, this->widget[AIL_WIDGET_LIST].right - 4, y, STR_AI_VERSION, TC_BLACK);
- static char buf[8];
- sprintf(buf, "%d", selected_info->GetVersion());
- DrawString(x + 5, this->widget[AIL_WIDGET_LIST].right - 4, y, buf, TC_BLACK);
+ SetDParam(0, selected_info->GetVersion());
+ DrawString(4, this->widget[AIL_WIDGET_INFO_BG].right - 4, y, STR_AI_VERSION, TC_BLACK);
y += 13;
SetDParamStr(0, selected_info->GetDescription());
DrawStringMultiLine(4, this->width - 8, y, this->widget[AIL_WIDGET_INFO_BG].bottom, STR_JUST_RAW_STRING);