From 4a94672fdcece115b07921361eb771058e1eef90 Mon Sep 17 00:00:00 2001 From: Gary Talent Date: Sun, 10 Dec 2023 17:16:48 -0600 Subject: [PATCH] [nostalgia/core/studio] Fix some use after move bugs --- .../studio/tilesheeteditor/commands/rmsubsheetcommand.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/nostalgia/modules/core/src/studio/tilesheeteditor/commands/rmsubsheetcommand.cpp b/src/nostalgia/modules/core/src/studio/tilesheeteditor/commands/rmsubsheetcommand.cpp index 5303de68..fae3c897 100644 --- a/src/nostalgia/modules/core/src/studio/tilesheeteditor/commands/rmsubsheetcommand.cpp +++ b/src/nostalgia/modules/core/src/studio/tilesheeteditor/commands/rmsubsheetcommand.cpp @@ -8,11 +8,11 @@ namespace nostalgia::core { core::RmSubSheetCommand::RmSubSheetCommand(TileSheet &img, TileSheet::SubSheetIdx idx) noexcept: m_img(img), - m_idx(std::move(idx)) { - m_parentIdx = idx; + m_idx(std::move(idx)), + m_parentIdx(m_idx) { m_parentIdx.pop_back(); auto &parent = m_img.getSubSheet(m_parentIdx); - m_sheet = parent.subsheets[*idx.back().value]; + m_sheet = parent.subsheets[*m_idx.back().value]; } void RmSubSheetCommand::redo() noexcept {