mirror of
https://github.com/ineedbots/iw2_bot_warfare.git
synced 2025-04-20 14:45:44 +00:00
strtok
This commit is contained in:
parent
8e604c25aa
commit
61ca6663aa
@ -1170,34 +1170,6 @@ keyCodeToString( a )
|
|||||||
return b;
|
return b;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
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;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Parses tokens into a waypoint obj
|
Parses tokens into a waypoint obj
|
||||||
*/
|
*/
|
||||||
@ -1272,7 +1244,7 @@ readWpsFromFile( mapname )
|
|||||||
if ( !isDefined( line ) || line == "" )
|
if ( !isDefined( line ) || line == "" )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
tokens = tokenizeLine( line, "," );
|
tokens = strtok( line, "," );
|
||||||
|
|
||||||
waypoint = parseTokensIntoWaypoint( tokens );
|
waypoint = parseTokensIntoWaypoint( tokens );
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user