diff options
| author | oy <Tom_Adams@web.de> | 2010-06-25 18:56:58 +0200 |
|---|---|---|
| committer | oy <Tom_Adams@web.de> | 2010-06-25 18:56:58 +0200 |
| commit | 82f5a56d89005b94493f63ca1d00031d194966b6 (patch) | |
| tree | 5e7129336c2eb5dde134feac515e776b8ddc2734 /src/game/editor/ed_editor.cpp | |
| parent | 822b002344b2da7fa6bc1565aa4ae8db0e801bae (diff) | |
| download | zcatch-82f5a56d89005b94493f63ca1d00031d194966b6.tar.gz zcatch-82f5a56d89005b94493f63ca1d00031d194966b6.zip | |
fixed crash in the map editor
Diffstat (limited to 'src/game/editor/ed_editor.cpp')
| -rw-r--r-- | src/game/editor/ed_editor.cpp | 38 |
1 files changed, 20 insertions, 18 deletions
diff --git a/src/game/editor/ed_editor.cpp b/src/game/editor/ed_editor.cpp index dbb5ffe8..8e777218 100644 --- a/src/game/editor/ed_editor.cpp +++ b/src/game/editor/ed_editor.cpp @@ -1328,24 +1328,26 @@ void CEditor::DoMapEditor(CUIRect View, CUIRect ToolBar) } CLayerGroup *g = GetSelectedGroup(); - m_Brush.m_OffsetX += g->m_OffsetX; - m_Brush.m_OffsetY += g->m_OffsetY; - m_Brush.m_ParallaxX = g->m_ParallaxX; - m_Brush.m_ParallaxY = g->m_ParallaxY; - m_Brush.Render(); - float w, h; - m_Brush.GetSize(&w, &h); - - IGraphics::CLineItem Array[4] = { - IGraphics::CLineItem(0, 0, w, 0), - IGraphics::CLineItem(w, 0, w, h), - IGraphics::CLineItem(w, h, 0, h), - IGraphics::CLineItem(0, h, 0, 0)}; - Graphics()->TextureSet(-1); - Graphics()->LinesBegin(); - Graphics()->LinesDraw(Array, 4); - Graphics()->LinesEnd(); - + if(g) + { + m_Brush.m_OffsetX += g->m_OffsetX; + m_Brush.m_OffsetY += g->m_OffsetY; + m_Brush.m_ParallaxX = g->m_ParallaxX; + m_Brush.m_ParallaxY = g->m_ParallaxY; + m_Brush.Render(); + float w, h; + m_Brush.GetSize(&w, &h); + + IGraphics::CLineItem Array[4] = { + IGraphics::CLineItem(0, 0, w, 0), + IGraphics::CLineItem(w, 0, w, h), + IGraphics::CLineItem(w, h, 0, h), + IGraphics::CLineItem(0, h, 0, 0)}; + Graphics()->TextureSet(-1); + Graphics()->LinesBegin(); + Graphics()->LinesDraw(Array, 4); + Graphics()->LinesEnd(); + } } } } |