Skip to content

Commit 4e55a72

Browse files
committed
Fixed original say command being changed
Fixed say commands not being recognized
1 parent 7ef0093 commit 4e55a72

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/core/modules/commands/commands_say.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,9 @@ void SayConCommand::Dispatch( const CCommand& command )
227227
// Create a new CCommand object that does not contain the first argument
228228
// (say or say_team) and is properly splitted
229229
CCommand stripped_command = CCommand();
230-
char* szCommand = (char*) command.ArgS();
230+
char szTempCommand[512];
231+
strcpy(szTempCommand, command.ArgS());
232+
char* szCommand = szTempCommand;
231233

232234
// Remove quotes (if existant), so the arguments are not recognized as a
233235
// single argument.
@@ -264,7 +266,7 @@ void SayConCommand::Dispatch( const CCommand& command )
264266
}
265267

266268
// Find if the command is registered
267-
SayCommandMap::iterator commandMapIter = g_SayCommandMap.find(szCommand);
269+
SayCommandMap::iterator commandMapIter = g_SayCommandMap.find(stripped_command[0]);
268270
if( commandMapIter != g_SayCommandMap.end() )
269271
{
270272
// Get the CSayCommandManager instance for the command

0 commit comments

Comments
 (0)