mirror of
https://github.com/ineedbots/iw3_bot_warfare.git
synced 2025-04-23 02:35:43 +00:00
Fixed bad waypoint loading
This commit is contained in:
parent
6c20b7fd71
commit
4df4970137
@ -264,6 +264,8 @@ watchSaveWaypointsCommand()
|
||||
if(!self adsButtonPressed())
|
||||
{
|
||||
self checkForWarnings();
|
||||
wait 1;
|
||||
|
||||
logprint("***********ABiliTy's WPDump**************\n\n");
|
||||
logprint("\n\n\n\n");
|
||||
mpnm=getMapName(getdvar("mapname"));
|
||||
@ -344,6 +346,8 @@ LoadWaypoints()
|
||||
self iPrintlnBold("Loading WPS...");
|
||||
load_waypoints();
|
||||
|
||||
wait 1;
|
||||
|
||||
self checkForWarnings();
|
||||
}
|
||||
|
||||
@ -365,11 +369,18 @@ checkForWarnings()
|
||||
|
||||
if(level.waypoints[i].childCount <= 0)
|
||||
self iprintln("WARNING: waypoint "+i+" childCount is "+level.waypoints[i].childCount);
|
||||
|
||||
else
|
||||
{
|
||||
if (!isDefined(level.waypoints[i].children) || !isDefined(level.waypoints[i].children.size))
|
||||
{
|
||||
self iprintln("WARNING: waypoint "+i+" children is not defined");
|
||||
}
|
||||
else
|
||||
{
|
||||
if(level.waypoints[i].childCount != level.waypoints[i].children.size)
|
||||
self iprintln("WARNING: waypoint "+i+" childCount is not "+level.waypoints[i].children.size);
|
||||
|
||||
for(h = 0; h < level.waypoints[i].children.size; h++)
|
||||
for (h = 0; h < level.waypoints[i].childCount; h++)
|
||||
{
|
||||
child = level.waypoints[i].children[h];
|
||||
|
||||
@ -378,6 +389,8 @@ checkForWarnings()
|
||||
else if(child == i)
|
||||
self iprintln("WARNING: waypoint "+i+" child "+child+" is itself");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(!isDefined(level.waypoints[i].type))
|
||||
{
|
||||
@ -759,6 +772,15 @@ load_waypoints()
|
||||
level.waypoints[i].bots["allies"] = 1;
|
||||
level.waypoints[i].bots["axis"] = 1;
|
||||
|
||||
if (!isDefined(level.waypoints[i].children) || !isDefined(level.waypoints[i].children.size))
|
||||
level.waypoints[i].children = [];
|
||||
|
||||
if (!isDefined(level.waypoints[i].origin))
|
||||
level.waypoints[i].origin = (0, 0, 0);
|
||||
|
||||
if (!isDefined(level.waypoints[i].type))
|
||||
level.waypoints[i].type = "crouch";
|
||||
|
||||
level.waypoints[i].childCount = level.waypoints[i].children.size;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user