Hide mission dialog before the level intro screens are shown, make sure it doesn't try to show it again after it was closed - fixing bad memory access
This commit is contained in:
parent
68a1458abd
commit
71dfec9fdb
|
@ -3,6 +3,7 @@ D1X-Rebirth Changelog
|
||||||
20100327
|
20100327
|
||||||
--------
|
--------
|
||||||
main/kmatrix.c, main/net_udp.c: Initialise 'playing' to 0 for UDP kmatrix, making sure player progresses to next level; always return 1 when starting to join a UDP game so it doesn't immediately return to the main menu
|
main/kmatrix.c, main/net_udp.c: Initialise 'playing' to 0 for UDP kmatrix, making sure player progresses to next level; always return 1 when starting to join a UDP game so it doesn't immediately return to the main menu
|
||||||
|
main/gameseq.c, main/menu.c: Hide mission dialog before the level intro screens are shown, make sure it doesn't try to show it again after it was closed - fixing bad memory access
|
||||||
|
|
||||||
20100326
|
20100326
|
||||||
--------
|
--------
|
||||||
|
|
|
@ -1274,6 +1274,8 @@ void StartNewLevelSub(int level_num, int page_in_textures)
|
||||||
//called when the player is starting a new level for normal game model
|
//called when the player is starting a new level for normal game model
|
||||||
void StartNewLevel(int level_num)
|
void StartNewLevel(int level_num)
|
||||||
{
|
{
|
||||||
|
hide_menus();
|
||||||
|
|
||||||
GameTime = FrameTime;
|
GameTime = FrameTime;
|
||||||
|
|
||||||
load_custom_data(get_level_file(level_num));
|
load_custom_data(get_level_file(level_num));
|
||||||
|
|
|
@ -131,6 +131,9 @@ void hide_menus(void)
|
||||||
window *wind;
|
window *wind;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
if (menus[i])
|
||||||
|
return; // there are already hidden menus
|
||||||
|
|
||||||
for (i = 0; (i < 15) && (wind = window_get_front()); i++)
|
for (i = 0; (i < 15) && (wind = window_get_front()); i++)
|
||||||
{
|
{
|
||||||
menus[i] = wind;
|
menus[i] = wind;
|
||||||
|
@ -148,7 +151,10 @@ void show_menus(void)
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (i = 0; (i < 16) && menus[i]; i++)
|
for (i = 0; (i < 16) && menus[i]; i++)
|
||||||
window_set_visible(menus[i], 1);
|
if (window_exists(menus[i]))
|
||||||
|
window_set_visible(menus[i], 1);
|
||||||
|
|
||||||
|
menus[0] = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
//pairs of chars describing ranges
|
//pairs of chars describing ranges
|
||||||
|
|
Loading…
Reference in a new issue