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 {