fixed updating editor element list for game engine when changing levels
authorHolger Schemel <info@artsoft.org>
Sat, 11 Mar 2017 16:34:34 +0000 (17:34 +0100)
committerHolger Schemel <info@artsoft.org>
Fri, 23 Mar 2018 22:21:10 +0000 (23:21 +0100)
src/editor.c

index 9b06a74e92313240432d5f4320a862141cb0aece..3b6d092d100fd86c68df092c88fe5007e571a0aa 100644 (file)
@@ -11895,6 +11895,8 @@ static void HandleCounterButtons(struct GadgetInfo *gi)
 
   if (counter_id == ED_COUNTER_ID_SELECT_LEVEL)
   {
+    int last_game_engine_type = level.game_engine_type;
+
     LoadLevel(level_nr);
     LoadScore(level_nr);
 
@@ -11905,6 +11907,13 @@ static void HandleCounterButtons(struct GadgetInfo *gi)
     ResetUndoBuffer();
     DrawEditModeWindow();
 
+    if (level.game_engine_type != last_game_engine_type)
+    {
+      /* update element selection list */
+      ReinitializeElementList();
+      ModifyEditorElementList();
+    }
+
     return;
   }