*not tested* but i think maybe by doing the opposite and if its the 0 block then BLOCK[CX,CY]=1 (uh if thats what its called, i havent used raycasting in a while..)
i might test this though.
well thats sounds cool, yeah here.
anyways I guess that could kind of work, making the enemy's go along the path would be harder but still can be done I think.