summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/rail_gui.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/rail_gui.cpp b/src/rail_gui.cpp
index 1ee994b0e..b2e2ec49a 100644
--- a/src/rail_gui.cpp
+++ b/src/rail_gui.cpp
@@ -1231,7 +1231,7 @@ void ReinitGuiAfterToggleElrail(bool disable)
void SetDefaultRailGui()
{
- if (_local_player == PLAYER_SPECTATOR) return;
+ if (_local_player == PLAYER_SPECTATOR || !IsValidPlayer(_local_player)) return;
extern RailType _last_built_railtype;
RailType rt = (RailType)_patches.default_rail_type;