Returns the number of the doors in the building.
Используется в GetNearestDoorBySoundPos() и HandleHierarchyRootLock().