Closed slothybutt closed 1 year ago
After the pathUp
script gets run, the editor rebuilds the selection contents from the mask. This happens in tools/selection/tracker.lua in fillContentsFromMask()
, where it figures out which objects/path nodes to put in the selection by looping over all of them, using their position to determine if they should be added.
When deselecting an area, it updates the selection contents by asking the world if it has something.
Due to the script illegally making those differ, it doesn't re-add the node to the selection after the script is run, put does try to deselect them, and crashes.
This crash is the fault of the pathUp
script doing something illegal do make something not completely supported, and won't be fixed in CH itself because CH is not doing anything really wrong (except perhaps letting scripts do too much).
On that note, here's a new pathUp.lua
that breaks CH slightly different to not cause this crash:
--[[
This is not completely supported by Chaoshead. Use at your own risk.
]]
for node in selection.contents.pathNodes:iterate() do
-- illegal decouple so it does gets overwritten
level.pathNodes[node.x][node.y - 1] = nil
-- can't just change the node's y due to https://github.com/tyoeer/Chaoshead/issues/116
level:movePathNode(node, node.x, node.y - 1)
end
I was area deselecting stacked paths and got a crash. Update: It seems like this crashes if you deselect the leftover selected square directly after using the script that moves path nodes up one tile. Using the "deselect all" button does not cause a crash, nor does it cause a crash if I hit "deselect all", then reselect the tile that was selected when the crash occured, and try to recreate the crash again