IsInSubroom() only works for polygons which only contain horizontal / vertical lines.
The algorithm checks,in which quadrant the nodes of the polygon are, where the position of the pedestrian/point was the origin of the coordinate system. Then, these quadrant numbers (1 .. 4) are added up and you can find, if a polygon is inside or outside.
It works not, if the polygon has edges, that are neither vertical nor horizontal. Please try it with pen and paper. I will add a scanned picture some time soon.