Continuation of the code snippet shows using “x > 0 && x < SCREEN_WIDTH” (and same for y) bounds, however other places where bounds are checked uses “x >= 0”.
It’s not entirely clear if this is a case of forgotten ‘=’ sign (to make it in line with other checks), or if the intention was to disallow the room to be adjacent to the edge of the map and as such missing a wall (in which case second check should’ve been “x < SCREEN_WIDTH - 1”)