Delete-E while playing a level now works properly - it closes Game_wind and sets Cursegp if necessary when going to the editor

This commit is contained in:
Chris Taylor 2012-04-14 15:06:12 +08:00
parent 4c9ac01f4b
commit ef6e5180db
4 changed files with 9 additions and 4 deletions

View file

@ -5,6 +5,7 @@ D1X-Rebirth Changelog
main/gamesave.c: Fix crash when loading a level in the editor
editor/segment.c, include/editor/editor.h, main/gamesave.c: Set Gamesave_current_version to correct version when making a new mine, move create_new_mine to gamesave.c
main/gamesave.c: Don't bother generating a game text file (.txm) every time a level is loaded, even if the EDITOR is compiled. Just when a level is saved
editor/med.c, main/game.c, main/gamecntl.c: Delete-E while playing a level now works properly - it closes Game_wind and sets Cursegp if necessary when going to the editor
20120412
--------

View file

@ -399,6 +399,9 @@ void init_editor()
menubar_init( "MED.MNU" );
Draw_all_segments = 1; // Say draw all segments, not just connected ones
if (!Cursegp)
Cursegp = &Segments[0];
init_autosave();

View file

@ -1052,7 +1052,10 @@ int game_handler(window *wind, d_event *event, void *data)
game_disable_cheats();
Game_mode = GM_GAME_OVER;
show_menus();
#ifdef EDITOR
if (!EditorWindow) // have to do it this way because of the necessary longjmp. Yuck.
#endif
show_menus();
Game_wind = NULL;
event_toggle_focus(0);
key_toggle_repeat(1);

View file

@ -822,10 +822,8 @@ int HandleTestKey(int key)
#ifdef EDITOR //editor-specific functions
case KEY_E + KEY_DEBUGGED:
#ifdef NETWORK
multi_leave_game();
#endif
init_editor();
window_close(Game_wind);
break;
case KEY_C + KEY_SHIFTED + KEY_DEBUGGED:
if (!Player_is_dead && !( Game_mode & GM_MULTI ))