From 58937e7e6b56e46eebb88e195667135c5d259f26 Mon Sep 17 00:00:00 2001 From: ehofman Date: Mon, 31 Mar 2003 08:25:00 +0000 Subject: [PATCH] Fix a bug where current_panel was called before it was initialized properly --- src/Main/globals.cxx | 1 + src/Main/main.cxx | 1 + 2 files changed, 2 insertions(+) diff --git a/src/Main/globals.cxx b/src/Main/globals.cxx index a1560f613..34432d99b 100644 --- a/src/Main/globals.cxx +++ b/src/Main/globals.cxx @@ -57,6 +57,7 @@ FGGlobals::FGGlobals() : autopilot( NULL ), route( NULL ), soundmgr( NULL ), + current_panel( NULL ), environment_mgr( NULL ), ATC_mgr( NULL ), ATC_display( NULL ), diff --git a/src/Main/main.cxx b/src/Main/main.cxx index ab2ded38f..86a030327 100644 --- a/src/Main/main.cxx +++ b/src/Main/main.cxx @@ -1399,6 +1399,7 @@ void fgReshape( int width, int height ) { int view_h; if ( (!fgGetBool("/sim/virtual-cockpit")) + && (globals->get_current_panel() != NULL) && fgPanelVisible() && idle_state == 1000 ) { view_h = (int)(height * (globals->get_current_panel()->getViewHeight() - globals->get_current_panel()->getYOffset()) / 768.0); -- 2.39.5