I'm still seeing situations where it doesn't work. Does find_path_for_crate also need to account for mutations to level?
I'm starting to suspect we can get rid of all the crate identity tracking.
RCEWATRPX3MDVMAIEBEYIRL2MXPQYD47IU7XQUKSUZVFJRU4AN4AC
function find_almost_empty_path(level, src, dst, cid)
-- like find_empty_path, but always allow going through empty_cell and never allow going through occupied_cell, regardless of what level says
function find_almost_empty_path(level, src, dst, empty_cell, occupied_cell)
if curr ~= CELL_WALL and (curr ~= CELL_CRATE or crate_id[y][x] ~= cid) and (curr ~= CELL_CRATE_ON_TARGET or crate_id[y][x] ~= cid) then
if (y == empty_cell.y and x == empty_cell.x) or
(not (y == occupied_cell.y and x == occupied_cell.x) and
curr ~= CELL_WALL and
curr ~= CELL_CRATE and
curr ~= CELL_CRATE_ON_TARGET) then