mirror of
https://github.com/ineedbots/iw4_bot_warfare.git
synced 2025-04-22 22:05:44 +00:00
Add warnings if waypoint unreachable
This commit is contained in:
parent
e73c553308
commit
0690a9703d
@ -499,6 +499,23 @@ checkForWarnings()
|
|||||||
if ( !isDefined( level.waypoints[i].angles ) && ( level.waypoints[i].type == "claymore" || level.waypoints[i].type == "tube" || ( level.waypoints[i].type == "crouch" && level.waypoints[i].children.size == 1 ) || level.waypoints[i].type == "climb" || level.waypoints[i].type == "grenade" ) )
|
if ( !isDefined( level.waypoints[i].angles ) && ( level.waypoints[i].type == "claymore" || level.waypoints[i].type == "tube" || ( level.waypoints[i].type == "crouch" && level.waypoints[i].children.size == 1 ) || level.waypoints[i].type == "climb" || level.waypoints[i].type == "grenade" ) )
|
||||||
self iprintln( "WARNING: waypoint " + i + " angles is undefined" );
|
self iprintln( "WARNING: waypoint " + i + " angles is undefined" );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// check reachability, assume bidirectional graph
|
||||||
|
|
||||||
|
wpIdx = randomInt( level.waypointCount );
|
||||||
|
|
||||||
|
for ( i = 0; i < level.waypointCount; i++ )
|
||||||
|
{
|
||||||
|
if ( i % 5 == 0 )
|
||||||
|
wait 0.05;
|
||||||
|
|
||||||
|
astar = AStarSearch( level.waypoints[wpIdx].origin, level.waypoints[i].origin, undefined, true );
|
||||||
|
|
||||||
|
if ( astar.size <= 0 )
|
||||||
|
self iprintln( "WARNING: waypoint " + wpIdx + " has no path to waypoint " + i );
|
||||||
|
}
|
||||||
|
|
||||||
|
self iprintln( "Waypoint warnings check completed." );
|
||||||
}
|
}
|
||||||
|
|
||||||
UnLinkWaypoint( nwp )
|
UnLinkWaypoint( nwp )
|
||||||
|
Loading…
x
Reference in New Issue
Block a user