fixed crash in the map editor

This commit is contained in:
oy 2010-06-25 18:56:58 +02:00
parent 822b002344
commit 82f5a56d89
2 changed files with 20 additions and 17 deletions

View file

@ -1328,6 +1328,8 @@ void CEditor::DoMapEditor(CUIRect View, CUIRect ToolBar)
}
CLayerGroup *g = GetSelectedGroup();
if(g)
{
m_Brush.m_OffsetX += g->m_OffsetX;
m_Brush.m_OffsetY += g->m_OffsetY;
m_Brush.m_ParallaxX = g->m_ParallaxX;
@ -1345,7 +1347,7 @@ void CEditor::DoMapEditor(CUIRect View, CUIRect ToolBar)
Graphics()->LinesBegin();
Graphics()->LinesDraw(Array, 4);
Graphics()->LinesEnd();
}
}
}
}

View file

@ -84,6 +84,7 @@ int CEditor::PopupGroup(CEditor *pEditor, CUIRect View)
pEditor->DoButton_Editor(&s_DeleteButton, Localize("Delete group"), 0, &Button, 0, Localize("Delete group")))
{
pEditor->m_Map.DeleteGroup(pEditor->m_SelectedGroup);
pEditor->m_SelectedGroup = max(0, pEditor->m_SelectedGroup-1);
return 1;
}