mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-20 06:58:20 +00:00
Merge pull request #7907 from archimede67/editor-fix-quads-crash
Editor: fix crash when changing layer with UP or DOWN while quad popup is opened
This commit is contained in:
commit
1337e522da
|
@ -828,6 +828,8 @@ CUI::EPopupMenuFunctionResult CEditor::PopupQuad(void *pContext, CUIRect View, b
|
||||||
{
|
{
|
||||||
CEditor *pEditor = static_cast<CEditor *>(pContext);
|
CEditor *pEditor = static_cast<CEditor *>(pContext);
|
||||||
std::vector<CQuad *> vpQuads = pEditor->GetSelectedQuads();
|
std::vector<CQuad *> vpQuads = pEditor->GetSelectedQuads();
|
||||||
|
if(pEditor->m_SelectedQuadIndex < 0 || pEditor->m_SelectedQuadIndex >= (int)vpQuads.size())
|
||||||
|
return CUI::POPUP_CLOSE_CURRENT;
|
||||||
CQuad *pCurrentQuad = vpQuads[pEditor->m_SelectedQuadIndex];
|
CQuad *pCurrentQuad = vpQuads[pEditor->m_SelectedQuadIndex];
|
||||||
std::shared_ptr<CLayerQuads> pLayer = std::static_pointer_cast<CLayerQuads>(pEditor->GetSelectedLayerType(0, LAYERTYPE_QUADS));
|
std::shared_ptr<CLayerQuads> pLayer = std::static_pointer_cast<CLayerQuads>(pEditor->GetSelectedLayerType(0, LAYERTYPE_QUADS));
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue