summaryrefslogtreecommitdiff
path: root/settings_gui.c
diff options
context:
space:
mode:
authorludde <ludde@openttd.org>2005-07-14 09:43:59 +0000
committerludde <ludde@openttd.org>2005-07-14 09:43:59 +0000
commit3e62457107457c8295076370425e9a1df44fa58c (patch)
treef6981bd89e076320ae37ab99f9dbf0619bca554c /settings_gui.c
parent1a046ff4c6f0295328ccc0cd6a4cd7a491f7ddbf (diff)
downloadopenttd-3e62457107457c8295076370425e9a1df44fa58c.tar.xz
(svn r2564) Fix: Fixed conceptual issue in network_gui.c. AllocateName is not meant to be used by GUI-code, because it modifies the "game-state".
Added a way to bind a C-string to an openttd string which doesn't modify the game state.
Diffstat (limited to 'settings_gui.c')
-rw-r--r--settings_gui.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/settings_gui.c b/settings_gui.c
index b9a0e0037..c2e7944ae 100644
--- a/settings_gui.c
+++ b/settings_gui.c
@@ -1384,21 +1384,21 @@ static void CustCurrencyWndProc(Window *w, WindowEvent *e)
case 1: // separator
if ( IS_INT_INSIDE(x, 10, 30) ) // clicked button
WP(w,def_d).data_1 = (1 << (line * 2 + 1));
- str = AllocateName(_str_separator, 0);
+ str = BindCString(_str_separator);
len = 1;
edittext = true;
break;
case 2: // prefix
if ( IS_INT_INSIDE(x, 10, 30) ) // clicked button
WP(w,def_d).data_1 = (1 << (line * 2 + 1));
- str = AllocateName(_currency_specs[23].prefix, 0);
+ str = BindCString(_currency_specs[23].prefix);
len = 12;
edittext = true;
break;
case 3: // suffix
if ( IS_INT_INSIDE(x, 10, 30) ) // clicked button
WP(w,def_d).data_1 = (1 << (line * 2 + 1));
- str = AllocateName(_currency_specs[23].suffix, 0);
+ str = BindCString(_currency_specs[23].suffix);
len = 12;
edittext = true;
break;
@@ -1432,7 +1432,6 @@ static void CustCurrencyWndProc(Window *w, WindowEvent *e)
250, // characters up to this width pixels, whichever is satisfied first
w->window_class,
w->window_number);
- if (str != STR_CONFIG_PATCHES_INT32) DeleteName(str);
}
w->flags4 |= 5 << WF_TIMEOUT_SHL;