Skip to content

Commit

Permalink
Fixed crash when changing layer visibility with no map loaded
Browse files Browse the repository at this point in the history
  • Loading branch information
Cruor committed Sep 3, 2022
1 parent c7575c0 commit f5721f0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/loaded_state.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand Down

0 comments on commit f5721f0

Please sign in to comment.