summaryrefslogtreecommitdiff
path: root/player_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 /player_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 'player_gui.c')
-rw-r--r--player_gui.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/player_gui.c b/player_gui.c
index 6359d97e6..d58eb0360 100644
--- a/player_gui.c
+++ b/player_gui.c
@@ -614,11 +614,9 @@ static void PlayerCompanyWndProc(Window *w, WindowEvent *e)
case 11: { /* Password protect company */
#ifdef ENABLE_NETWORK
if (!IsWindowOfPrototype(w, _other_player_company_widgets)) {
- StringID str;
WP(w,def_d).byte_1 = 2;
- str = AllocateName(_network_player_info[_local_player].password, 0);
- ShowQueryString(str, STR_SET_COMPANY_PASSWORD, sizeof(_network_player_info[_local_player].password), 250, w->window_class, w->window_number);
- DeleteName(str);
+ ShowQueryString(BindCString(_network_player_info[_local_player].password),
+ STR_SET_COMPANY_PASSWORD, sizeof(_network_player_info[_local_player].password), 250, w->window_class, w->window_number);
}
#endif
} break;