| 2707 | } |
| 2708 | |
| 2709 | bool CBot::CurrentWPIsValid() |
| 2710 | { |
| 2711 | if (!m_pCurrentWaypoint) |
| 2712 | { |
| 2713 | //condebug("Invalid WP: Is NULL"); |
| 2714 | return false; |
| 2715 | } |
| 2716 | |
| 2717 | // check if the bot has been trying to get to this waypoint for a while... |
| 2718 | if ((m_iWaypointTime + 5000) < lastmillis) |
| 2719 | { |
| 2720 | condebug("Invalid WP: time over"); |
| 2721 | return false; |
| 2722 | } |
| 2723 | |
| 2724 | #ifndef RELEASE_BUILD |
| 2725 | if (!IsVisible(m_pCurrentWaypoint->pNode->v_origin)) |
| 2726 | condebug("Invalid WP: Not visible"); |
| 2727 | #endif |
| 2728 | |
| 2729 | return (IsVisible(m_pCurrentWaypoint->pNode->v_origin)); |
| 2730 | } |
| 2731 | |
| 2732 | bool CBot::ReachedGoalWP() |
| 2733 | { |