This commit is contained in:
ineed bots 2023-12-02 16:33:34 -06:00
parent 8406369f6b
commit 622e352062

View File

@ -925,34 +925,6 @@ float( num )
return GetDvarFloat( "temp_dvar_bot_util" ); return GetDvarFloat( "temp_dvar_bot_util" );
} }
/*
Tokenizes a string (strtok has limits...) (only one char tok)
*/
tokenizeLine( line, tok )
{
tokens = [];
token = "";
for ( i = 0; i < line.size; i++ )
{
c = line[i];
if ( c == tok )
{
tokens[tokens.size] = token;
token = "";
continue;
}
token += c;
}
tokens[tokens.size] = token;
return tokens;
}
/* /*
If the string starts with If the string starts with
*/ */
@ -1009,7 +981,7 @@ getWaypointLinesFromFile( filename )
result = spawnStruct(); result = spawnStruct();
result.lines = []; result.lines = [];
// todo read line by line // todo read line by line, max string len in gsc is 65535, we are okay for all the waypoints for now
waypointStr = BotBuiltinFileRead( filename ); waypointStr = BotBuiltinFileRead( filename );
if ( !isDefined( waypointStr ) ) if ( !isDefined( waypointStr ) )
@ -1059,7 +1031,7 @@ readWpsFromFile( mapname )
for ( i = 1; i <= waypointCount; i++ ) for ( i = 1; i <= waypointCount; i++ )
{ {
tokens = tokenizeLine( res.lines[i], "," ); tokens = strtok( res.lines[i], "," );
waypoint = parseTokensIntoWaypoint( tokens ); waypoint = parseTokensIntoWaypoint( tokens );