mirror of
https://github.com/ineedbots/iw5_bot_warfare.git
synced 2025-04-25 15:19:14 +00:00
strtok
This commit is contained in:
parent
5ceeabcc2a
commit
119a8f8639
@ -895,34 +895,6 @@ Round( x )
|
||||
return y;
|
||||
}
|
||||
|
||||
/*
|
||||
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
|
||||
*/
|
||||
@ -1028,7 +1000,7 @@ readWpsFromFile( mapname )
|
||||
|
||||
for ( i = 1; i <= waypointCount; i++ )
|
||||
{
|
||||
tokens = tokenizeLine( res.lines[i], "," );
|
||||
tokens = strtok( res.lines[i], "," );
|
||||
|
||||
waypoint = parseTokensIntoWaypoint( tokens );
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user