From de087bd80a8117d8d2e4e65db1a5d925543eabd7 Mon Sep 17 00:00:00 2001 From: Dennis Felsing Date: Tue, 12 Jul 2022 19:35:43 +0200 Subject: [PATCH] Fix shift + left click in editor (fixes #5626) --- src/game/editor/editor.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/game/editor/editor.cpp b/src/game/editor/editor.cpp index 39420cbdb..e1c858ba2 100644 --- a/src/game/editor/editor.cpp +++ b/src/game/editor/editor.cpp @@ -2636,7 +2636,8 @@ void CEditor::DoMapEditor(CUIRect View) size_t BrushIndex = k; if(m_Brush.m_vpLayers.size() != NumEditLayers) BrushIndex = 0; - apEditLayers[k]->FillSelection(m_Brush.IsEmpty(), m_Brush.m_vpLayers[BrushIndex], r); + if(BrushIndex < m_Brush.m_vpLayers.size()) + apEditLayers[k]->FillSelection(m_Brush.IsEmpty(), m_Brush.m_vpLayers[BrushIndex], r); } } else