From 6895cdc34352373a63ce12f7a7ac538b03a5a471 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20M=C3=BCller?= Date: Sat, 2 Mar 2024 13:12:21 +0100 Subject: [PATCH] Fix editor crash when right-clicking bezier control points The color selection should only be shown for normal envelope points but not for bezier control points, because it always changes the previously selected normal envelope point. This caused the client to crash when right-clicking a bezier control point when no normal envelope point was previously selected. Closes #8020. --- src/game/editor/editor.cpp | 2 +- src/game/editor/popups.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/game/editor/editor.cpp b/src/game/editor/editor.cpp index 382e376cf..7d7eef8af 100644 --- a/src/game/editor/editor.cpp +++ b/src/game/editor/editor.cpp @@ -6748,7 +6748,7 @@ void CEditor::RenderEnvelopeEditor(CUIRect View) { static SPopupMenuId s_PopupEnvPointId; const auto &&ShowPopupEnvPoint = [&]() { - UI()->DoPopupMenu(&s_PopupEnvPointId, UI()->MouseX(), UI()->MouseY(), 150, 56 + (pEnvelope->GetChannels() == 4 ? 16.0f : 0.0f), this, PopupEnvPoint); + UI()->DoPopupMenu(&s_PopupEnvPointId, UI()->MouseX(), UI()->MouseY(), 150, 56 + (pEnvelope->GetChannels() == 4 && !IsTangentSelected() ? 16.0f : 0.0f), this, PopupEnvPoint); }; if(s_Operation == EEnvelopeEditorOp::OP_NONE) diff --git a/src/game/editor/popups.cpp b/src/game/editor/popups.cpp index 80c36a53a..daca7ab54 100644 --- a/src/game/editor/popups.cpp +++ b/src/game/editor/popups.cpp @@ -1360,7 +1360,7 @@ CUI::EPopupMenuFunctionResult CEditor::PopupEnvPoint(void *pContext, CUIRect Vie std::shared_ptr pEnvelope = pEditor->m_Map.m_vpEnvelopes[pEditor->m_SelectedEnvelope]; - if(pEnvelope->GetChannels() == 4) + if(pEnvelope->GetChannels() == 4 && !pEditor->IsTangentSelected()) { View.HSplitTop(RowHeight, &Row, &View); View.HSplitTop(4.0f, nullptr, &View);