Instead of maintaining heights of the missiles, we can maintain the distance (from being launched) of them. (In code, by adding the CalculateDistance() function, and the startingpoint_ parameter)
We extend the IsBlockedByObstacles() function to MissileBlockedByObstacles() function, taking the distance into consideration.
When dis > 12.0, we consider the missile to have returned to the ground.
When 4.0 <= dis <= 8.0, we say the missile cannot be blocked by any obstacle.
In other cases, we still call the IsBlockedByObstacles() function.