There is no safeguard against going out of bounds with the knight. (simplest solution would be to make all-walls the layout the game falls back to when the map's layout isn't defined, that way the knight will never see jumping into an OOB area as valid)