Fix a bug where current_panel was called before it was initialized properly
This commit is contained in:
parent
67ad32267f
commit
58937e7e6b
2 changed files with 2 additions and 0 deletions
|
@ -57,6 +57,7 @@ FGGlobals::FGGlobals() :
|
||||||
autopilot( NULL ),
|
autopilot( NULL ),
|
||||||
route( NULL ),
|
route( NULL ),
|
||||||
soundmgr( NULL ),
|
soundmgr( NULL ),
|
||||||
|
current_panel( NULL ),
|
||||||
environment_mgr( NULL ),
|
environment_mgr( NULL ),
|
||||||
ATC_mgr( NULL ),
|
ATC_mgr( NULL ),
|
||||||
ATC_display( NULL ),
|
ATC_display( NULL ),
|
||||||
|
|
|
@ -1399,6 +1399,7 @@ void fgReshape( int width, int height ) {
|
||||||
int view_h;
|
int view_h;
|
||||||
|
|
||||||
if ( (!fgGetBool("/sim/virtual-cockpit"))
|
if ( (!fgGetBool("/sim/virtual-cockpit"))
|
||||||
|
&& (globals->get_current_panel() != NULL)
|
||||||
&& fgPanelVisible() && idle_state == 1000 ) {
|
&& fgPanelVisible() && idle_state == 1000 ) {
|
||||||
view_h = (int)(height * (globals->get_current_panel()->getViewHeight() -
|
view_h = (int)(height * (globals->get_current_panel()->getViewHeight() -
|
||||||
globals->get_current_panel()->getYOffset()) / 768.0);
|
globals->get_current_panel()->getYOffset()) / 768.0);
|
||||||
|
|
Loading…
Reference in a new issue