Per BMM, page 73, "Combat Within Buildings":
A 'Mech on a building's roof is not considered within a building, and so if it fires on a 'Mech in a building it uses the rules given above under Attacking 'Mechs Inside Buildings.
This is contradicted by the example text, where a BattleMaster on Level 0 of a 4-level building is unable to cannot attack the Wolverine on level 4 (the rooftop), because
More than two hexes and/or levels of intervening building between attacker and target means line of sight is not valid
This reasoning shouldn't apply, because the Wolverine is not considered within the building. Instead, the rules from "Attacking 'Mechs Inside Buildings" should be used:
An attacker must have line of sight to a building hex, as well as to the target 'Mech. Building hexes block LOS, but the building hex a 'Mech is in does not count (since it is not intervening terrain).
This creates another strange situation, because by these rules the Wolverine on the rooftop should be able to see and fire on the BattleMaster on level 0, and vice versa, since there's no intervening terrain. If this is the correct interpretation, than the consequence is that line of sight between the BattleMaster on level 0 and another 'Mech on level 3 of the same building hex would be blocked by the presence of 2 intervening levels, but LOS between the BattleMaster and the Wolverine on the rooftop at level 4 would be open. Is that the intent of the rules/am I understanding things correctly?