How to prevent player from spawning in a wall(Cellular Automata)

I am creating a game using Cellular Automata (I watched Sebastian Lague’s tutorial series to do that) but the player sometimes spawns into the walls of the level. Can anyone help me to fix that?

Nevermind, I found a way to do it.