I have this code which is for an ingame speedwalk, trouble is i now noticed that it goes backwards through the string and not forwards, is this due to changes in gcc4x. Anyways im not sure why its going backwards now when it used to go forwards, anyone see anything obvious thats wrong.
void do_speedwalk( CHAR_DATA * ch, char *argument )
{
char buf[MSL];
char arg[MIL];
char *direction;
bool found = FALSE;
if( !ch->desc || NULLSTR( argument ) )
{
send_to_char( "You must include directions. Read help speedwalk for more information.", ch );
return;
}
buf[0] = '\0';
while( *argument != '\0' )
{
argument = one_argument( argument, arg );
strcat( buf, arg );
}
send_to_char( "You start to walk...", ch );
for( direction = buf + strlen( buf ) - 1; direction >= buf; direction-- )
{
if( !isdigit( *direction ) )
{
switch ( *direction )
{
case 'N':
case 'n':
//removed for clarity sake.
default:
send_to_char( "Invalid direction!", ch );
return;
}
}
}
return;
}