case convert only the first parameter of a command (so that contstants in the 2nd and later params don't get munged)
This commit is contained in:
@@ -618,13 +618,8 @@ void Actor::AddRotationR( float rot )
|
||||
|
||||
void Actor::Command( const CString &sCommands )
|
||||
{
|
||||
// Convert to lower so we can do case insensitive compared later.
|
||||
// TODO: Is this the best place to convert?
|
||||
CString sCommandsLower = sCommands;
|
||||
sCommandsLower.MakeLower();
|
||||
|
||||
vector<ParsedCommand> vCommands;
|
||||
ParseCommands( sCommandsLower, vCommands );
|
||||
ParseCommands( sCommands, vCommands );
|
||||
|
||||
for( unsigned i=0; i<vCommands.size(); i++ )
|
||||
this->HandleCommand( vCommands[i] );
|
||||
|
||||
@@ -28,10 +28,17 @@ void ParsedCommand::Set( const CString &sCommand )
|
||||
|
||||
vTokens.resize( vsTokens.size() );
|
||||
|
||||
for( unsigned j=0; j<vsTokens.size(); j++ )
|
||||
for( unsigned i=0; i<vsTokens.size(); i++ )
|
||||
{
|
||||
const CString &sToken = vsTokens[j];
|
||||
vTokens[j].Set( sToken );
|
||||
CString &sToken = vsTokens[i];
|
||||
|
||||
// TRICKY: The first parameter is the command name. This is case
|
||||
// insensitive. Convert it to lowercase now so that we can do
|
||||
// case sensitive compares later.
|
||||
if( i == 0 )
|
||||
sToken.MakeLower();
|
||||
|
||||
vTokens[i].Set( sToken );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user