Fixed crash where selected entity in editor would get deleted in game mode and cause a crash when switching to editor mode

dev
Shariq Shah 6 years ago
parent 99b2abe0ec
commit 2ea45b6743
  1. 2
      src/common/version.h
  2. 3
      src/game/editor.c
  3. 2
      todo.txt

@ -4,7 +4,7 @@
/* Auto generated version file. DO NOT MODIFY */ /* Auto generated version file. DO NOT MODIFY */
#define SYMMETRY_VERSION_MAJOR 0 #define SYMMETRY_VERSION_MAJOR 0
#define SYMMETRY_VERSION_MINOR 1 #define SYMMETRY_VERSION_MINOR 1
#define SYMMETRY_VERSION_REVISION 329 #define SYMMETRY_VERSION_REVISION 330
#define SYMMETRY_VERSION_BRANCH "dev" #define SYMMETRY_VERSION_BRANCH "dev"
#endif #endif

@ -2589,5 +2589,8 @@ void editor_post_update(struct Editor* editor)
{ {
if(editor->hovered_entity && !(editor->hovered_entity->flags & EF_ACTIVE)) if(editor->hovered_entity && !(editor->hovered_entity->flags & EF_ACTIVE))
editor->hovered_entity = NULL; editor->hovered_entity = NULL;
if(editor->selected_entity && !(editor->selected_entity->flags & EF_ACTIVE))
editor_entity_select(editor, NULL);
} }

@ -1,5 +1,4 @@
Todo: Todo:
- Fix crash where if entity selected in editor is deleted in game mode and then returning to editor mode causes a crash
- Implement flag for ignoring collisions with certain entities - Implement flag for ignoring collisions with certain entities
- Implement separate property window for player related variables that can be shown in the editor similar to renderer settings etc - Implement separate property window for player related variables that can be shown in the editor similar to renderer settings etc
- Implement game gui either with a separate nuklear context or as part of existing context - Implement game gui either with a separate nuklear context or as part of existing context
@ -404,3 +403,4 @@ Done:
* Add another ambient sound_source entity as child to enemy entity * Add another ambient sound_source entity as child to enemy entity
* Add all sound source properties to propery inspector * Add all sound source properties to propery inspector
* Implement Triggers * Implement Triggers
* Fix crash where if entity selected in editor is deleted in game mode and then returning to editor mode causes a crash
Loading…
Cancel
Save