diff --git a/src/jasper/modules/world/src/studio/worldobjectseteditor/worldobjectseteditor-imgui.cpp b/src/jasper/modules/world/src/studio/worldobjectseteditor/worldobjectseteditor-imgui.cpp index b25828e..691b9ef 100644 --- a/src/jasper/modules/world/src/studio/worldobjectseteditor/worldobjectseteditor-imgui.cpp +++ b/src/jasper/modules/world/src/studio/worldobjectseteditor/worldobjectseteditor-imgui.cpp @@ -144,15 +144,17 @@ void WorldObjectSetEditorImGui::loadObj() noexcept { w = m_visibleSubsheet->columns; h = m_visibleSubsheet->rows; } - auto const idx = getTileIdx( + auto const tileIdx = getTileIdx( *m_tileSheet, subsheetId).or_value(0); + auto const&palAddr = m_doc.palettes.size() > obj.palBank ? + m_doc.palettes[obj.palBank] : ox::FileAddress{}; oxLogError(m_colView.setup( m_doc.tilesheet, - m_doc.palettes[obj.palBank], + palAddr, w, h, - static_cast(idx), + static_cast(tileIdx), obj.collisionMap)); }