diff options
author | Darkvater <darkvater@openttd.org> | 2006-10-31 21:15:56 +0000 |
---|---|---|
committer | Darkvater <darkvater@openttd.org> | 2006-10-31 21:15:56 +0000 |
commit | eadf788cc5d068622f20221566f4027625090689 (patch) | |
tree | f1aae895580a4a2bc7864f645fae39e9c2bc7669 /dock_gui.c | |
parent | 993cb13c8dde55d77b732bba55bf3c94b0ea9216 (diff) | |
download | openttd-eadf788cc5d068622f20221566f4027625090689.tar.xz |
(svn r7022) -Fix [FS#292]: Properly guard against viewing company-sensitive information from
invalid players (eg spectators) which could lead to crashes.
Diffstat (limited to 'dock_gui.c')
-rw-r--r-- | dock_gui.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/dock_gui.c b/dock_gui.c index 571c91985..a58fe29fa 100644 --- a/dock_gui.c +++ b/dock_gui.c @@ -214,7 +214,8 @@ static const WindowDesc _build_docks_toolbar_desc = { void ShowBuildDocksToolbar(void) { - if (_current_player == PLAYER_SPECTATOR) return; + if (!IsValidPlayer(_current_player)) return; + DeleteWindowById(WC_BUILD_TOOLBAR, 0); AllocateWindowDesc(&_build_docks_toolbar_desc); if (_patches.link_terraform_toolbar) ShowTerraformToolbar(); |