diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 6477048d4..a1ad0e74b 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -6,6 +6,7 @@ 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 +editor/med.c, main/dumpmine.c, main/gamecntl.c, ui/ui.c: Fix bugs switching between game and editor and back: make sure ModeFlag is set to 0 before it has any chance to show an alert message, fixing a crash; allow OBJ_NONE in Assert; make Game_wind invisible when loading editor in case we show an alert; call mouse_flush() in ui_init() to fix mouse issues 20120412 -------- diff --git a/editor/med.c b/editor/med.c index 3247dc40a..3aa66e509 100644 --- a/editor/med.c +++ b/editor/med.c @@ -464,9 +464,9 @@ void init_editor() FNTScaleX = FNTScaleY = 1; // No font scaling! ui_pad_goto(padnum); - gamestate_restore_check(); - ModeFlag = 0; + + gamestate_restore_check(); } int ShowAbout() diff --git a/main/dumpmine.c b/main/dumpmine.c index 39e55074a..562190989 100644 --- a/main/dumpmine.c +++ b/main/dumpmine.c @@ -50,7 +50,7 @@ char *object_types(int objnum) { int type = Objects[objnum].type; - Assert((type >= 0) && (type < MAX_OBJECT_TYPES)); + Assert((type == OBJ_NONE) || ((type >= 0) && (type < MAX_OBJECT_TYPES))); return Object_type_names[type]; } diff --git a/main/gamecntl.c b/main/gamecntl.c index e7ad5aa3b..c2ae4e6ec 100644 --- a/main/gamecntl.c +++ b/main/gamecntl.c @@ -822,6 +822,7 @@ int HandleTestKey(int key) #ifdef EDITOR //editor-specific functions case KEY_E + KEY_DEBUGGED: + window_set_visible(Game_wind, 0); // don't let the game do anything while we set the editor up init_editor(); window_close(Game_wind); break; diff --git a/ui/ui.c b/ui/ui.c index e1b105a62..a062c95ad 100644 --- a/ui/ui.c +++ b/ui/ui.c @@ -51,6 +51,8 @@ void ui_init() CWHITE = gr_find_closest_color( 50, 50, 50 ); CBRIGHT = gr_find_closest_color( 58, 58, 58 ); CRED = gr_find_closest_color( 63, 0, 0 ); + + mouse_flush(); //key_init();