mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
Merge #6822
6822: Fix editor crashes with quad point and other popup menus r=def- a=Robyt3 Closes #6817. ## Checklist - [X] Tested the change ingame - [ ] Provided screenshots if it is a visual change - [ ] Tested in combination with possibly related configuration options - [ ] Written a unit test (especially base/) or added coverage to integration test - [ ] Considered possible null pointers and out of bounds array indexing - [ ] Changed no physics that affect existing maps - [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional) Co-authored-by: Robert Müller <robytemueller@gmail.com>
This commit is contained in:
commit
43324d4d57
|
@ -6577,12 +6577,9 @@ void CEditor::RenderMousePointer()
|
|||
|
||||
void CEditor::Reset(bool CreateDefault)
|
||||
{
|
||||
UI()->ClosePopupMenus();
|
||||
m_Map.Clean();
|
||||
|
||||
//delete undo file
|
||||
char aBuffer[1024];
|
||||
m_pStorage->GetCompletePath(IStorage::TYPE_SAVE, "editor/", aBuffer, sizeof(aBuffer));
|
||||
|
||||
mem_zero(m_apSavedBrushes, sizeof m_apSavedBrushes);
|
||||
|
||||
// create default layers
|
||||
|
|
|
@ -1199,6 +1199,8 @@ CUI::EPopupMenuFunctionResult CEditor::PopupPoint(void *pContext, CUIRect View,
|
|||
{
|
||||
CEditor *pEditor = static_cast<CEditor *>(pContext);
|
||||
std::vector<CQuad *> vpQuads = pEditor->GetSelectedQuads();
|
||||
if(!in_range<int>(pEditor->m_SelectedQuadIndex, 0, vpQuads.size() - 1))
|
||||
return CUI::POPUP_CLOSE_CURRENT;
|
||||
CQuad *pCurrentQuad = vpQuads[pEditor->m_SelectedQuadIndex];
|
||||
|
||||
enum
|
||||
|
|
Loading…
Reference in a new issue