summaryrefslogtreecommitdiff
path: root/rail_gui.c
diff options
context:
space:
mode:
authorDarkvater <Darkvater@openttd.org>2006-10-31 21:15:56 +0000
committerDarkvater <Darkvater@openttd.org>2006-10-31 21:15:56 +0000
commit0e1485f55e692478c3bf9dbca428a46c1ac20cd4 (patch)
treef1aae895580a4a2bc7864f645fae39e9c2bc7669 /rail_gui.c
parentb2c7a408edab0317d1d67c1d5d9ef8f0043f5291 (diff)
downloadopenttd-0e1485f55e692478c3bf9dbca428a46c1ac20cd4.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 'rail_gui.c')
-rw-r--r--rail_gui.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/rail_gui.c b/rail_gui.c
index 60fcdafb9..bf8fb3bcc 100644
--- a/rail_gui.c
+++ b/rail_gui.c
@@ -589,7 +589,7 @@ void ShowBuildRailToolbar(RailType railtype, int button)
{
Window *w;
- if (_current_player == PLAYER_SPECTATOR) return;
+ if (!IsValidPlayer(_current_player)) return;
if (!ValParamRailtype(railtype)) return;
// don't recreate the window if we're clicking on a button and the window exists.