summaryrefslogtreecommitdiff
path: root/src/editor/view3d.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/editor/view3d.cpp')
-rw-r--r--src/editor/view3d.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/editor/view3d.cpp b/src/editor/view3d.cpp
index 3729823..292760a 100644
--- a/src/editor/view3d.cpp
+++ b/src/editor/view3d.cpp
@@ -48,7 +48,7 @@ void gui_editor_3dview_draw_showpos( GUI_EDITOR_3DVIEW* view ) {
void gui_editor_3dview_draw_fn( void* ptr ) {
GUI_EDITOR_3DVIEW* view = (GUI_EDITOR_3DVIEW*)ptr;
- if( !objl->pl )
+ if( !editor || !editor->map || !objl->pl )
return;
I32 x = gui_relx( view );
@@ -82,6 +82,9 @@ void gui_editor_3dview_draw_fn( void* ptr ) {
void gui_editor_3dview_input_fn( void* ptr ) {
GUI_EDITOR_3DVIEW* view = (GUI_EDITOR_3DVIEW*)ptr;
+ if( !editor || !editor->map )
+ return;
+
if( !input.mouselock )
gui_base_input_fn( view );
@@ -108,6 +111,9 @@ void gui_editor_3dview_create_toolbar( GUI_EDITOR_3DVIEW* view ) {
I32 x = 1, y = view->h - 4;
gui_button( x, y, 90, 18, "compile bsp", pfn( void* b ) {
+ if( !editor || !editor->map )
+ return;
+
if( editor->map->bsp )
bsp_free( editor->map->bsp );
bsp_build_map( editor->map );