diff --git a/src/loaded_state.lua b/src/loaded_state.lua index f792e306..47eefcbd 100644 --- a/src/loaded_state.lua +++ b/src/loaded_state.lua @@ -284,6 +284,7 @@ function state.getLayerVisible(layer) end function state.setLayerVisible(layer, visible, silent) + local rooms = state.map and state.map.rooms or {} local info = state.layerInformation[layer] if not info then @@ -301,7 +302,7 @@ function state.setLayerVisible(layer, visible, silent) local selectedItem, selectedItemType = state.getSelectedItem() celesteRender.clearBatchingTasks() - celesteRender.forceRedrawVisibleRooms(state.map.rooms, state, selectedItem, selectedItemType) + celesteRender.forceRedrawVisibleRooms(rooms, state, selectedItem, selectedItemType) end end diff --git a/src/snapshot_utils.lua b/src/snapshot_utils.lua index dea1f23b..a9b5bc7d 100644 --- a/src/snapshot_utils.lua +++ b/src/snapshot_utils.lua @@ -135,7 +135,7 @@ local function applyRoomChanges(data, target) end celesteRender.invalidateRoomCache(targetRoom) - celesteRender.forceRoomBatchRender(targetRoom, viewportHandler.viewport) + celesteRender.forceRoomBatchRender(targetRoom, state) end end