Skip to content

Commit 9ff706b

Browse files
committed
Fix a crash when delete a sound in editor
1 parent 186cf51 commit 9ff706b

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/game/editor/popups.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1872,6 +1872,7 @@ CUi::EPopupMenuFunctionResult CEditor::PopupSound(void *pContext, CUIRect View,
18721872
{
18731873
pEditor->m_Map.m_vpSounds.erase(pEditor->m_Map.m_vpSounds.begin() + pEditor->m_SelectedSound);
18741874
pEditor->m_Map.ModifySoundIndex(gs_ModifyIndexDeleted(pEditor->m_SelectedSound));
1875+
pEditor->m_ToolbarPreviewSound = -1;
18751876
}
18761877
return CUi::POPUP_CLOSE_CURRENT;
18771878
}
@@ -2228,6 +2229,7 @@ CUi::EPopupMenuFunctionResult CEditor::PopupEvent(void *pContext, CUIRect View,
22282229
{
22292230
pEditor->m_Map.m_vpSounds.erase(pEditor->m_Map.m_vpSounds.begin() + pEditor->m_SelectedSound);
22302231
pEditor->m_Map.ModifySoundIndex(gs_ModifyIndexDeleted(pEditor->m_SelectedSound));
2232+
pEditor->m_ToolbarPreviewSound = -1;
22312233
}
22322234
pEditor->m_PopupEventWasActivated = false;
22332235
return CUi::POPUP_CLOSE_CURRENT;

0 commit comments

Comments
 (0)