Being adjacent to a character or floor element requires your character to be physically in another adjacent square, hence the distance of 1.A wall is functionally a boundary between two adjacent squares, and has a distance of 0 to both; in a way you can say that the wall is "in" both squares so your shooting character is in fact "in" the same square as the wall, hence the distance of 0.