From: ehofman Date: Mon, 31 Mar 2003 08:25:00 +0000 (+0000) Subject: Fix a bug where current_panel was called before it was initialized properly X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=58937e7e6b56e46eebb88e195667135c5d259f26;p=flightgear.git Fix a bug where current_panel was called before it was initialized properly --- 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);