[nostalgia/core/studio] Fix some use after move bugs

This commit is contained in:
Gary Talent 2023-12-10 17:16:48 -06:00
parent d22c968561
commit 4a94672fdc

View File

@ -8,11 +8,11 @@ namespace nostalgia::core {
core::RmSubSheetCommand::RmSubSheetCommand(TileSheet &img, TileSheet::SubSheetIdx idx) noexcept: core::RmSubSheetCommand::RmSubSheetCommand(TileSheet &img, TileSheet::SubSheetIdx idx) noexcept:
m_img(img), m_img(img),
m_idx(std::move(idx)) { m_idx(std::move(idx)),
m_parentIdx = idx; m_parentIdx(m_idx) {
m_parentIdx.pop_back(); m_parentIdx.pop_back();
auto &parent = m_img.getSubSheet(m_parentIdx); 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 { void RmSubSheetCommand::redo() noexcept {