From a41f1c1def0a7a2940508c7df3cc559303486dde Mon Sep 17 00:00:00 2001 From: Dennis Felsing Date: Sat, 6 Aug 2022 02:06:40 +0200 Subject: [PATCH] Fix shift-leftclick-drag with empty selection to delete (fixes #5705) --- src/game/editor/editor.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/game/editor/editor.cpp b/src/game/editor/editor.cpp index ac556a6ab..b56507036 100644 --- a/src/game/editor/editor.cpp +++ b/src/game/editor/editor.cpp @@ -2637,8 +2637,8 @@ void CEditor::DoMapEditor(CUIRect View) size_t BrushIndex = k; if(m_Brush.m_vpLayers.size() != NumEditLayers) BrushIndex = 0; - if(BrushIndex < m_Brush.m_vpLayers.size()) - apEditLayers[k]->FillSelection(m_Brush.IsEmpty(), m_Brush.m_vpLayers[BrushIndex], r); + CLayer *pBrush = m_Brush.IsEmpty() ? nullptr : m_Brush.m_vpLayers[BrushIndex]; + apEditLayers[k]->FillSelection(m_Brush.IsEmpty(), pBrush, r); } } else