mirror of
https://github.com/ENSL/NS.git
synced 2024-11-10 07:11:38 +00:00
fix for typing another key in chat before releasing enter key causing it to send the message
This commit is contained in:
parent
a04cc4fd40
commit
1748d39d7e
1 changed files with 21 additions and 18 deletions
|
@ -243,31 +243,34 @@ void ChatPanel::KeyEvent(int iKeydown)
|
|||
}
|
||||
if (state[SDL_SCANCODE_RETURN])
|
||||
{
|
||||
std::string theCommand;
|
||||
if (iKeydown && !bTextinput)
|
||||
{
|
||||
std::string theCommand;
|
||||
|
||||
theCommand += mChatMode;
|
||||
theCommand += mChatMode;
|
||||
|
||||
theCommand += " \"";
|
||||
theCommand += " \"";
|
||||
|
||||
// Replace all ';' characters with ':' characters since we can't have
|
||||
// ';' characters on a console message.
|
||||
// Replace all ';' characters with ':' characters since we can't have
|
||||
// ';' characters on a console message.
|
||||
|
||||
for (unsigned int i = 0; i < mText.length(); ++i)
|
||||
{
|
||||
if (mText[i] == ';')
|
||||
{
|
||||
mText[i] = ':';
|
||||
}
|
||||
}
|
||||
for (unsigned int i = 0; i < mText.length(); ++i)
|
||||
{
|
||||
if (mText[i] == ';')
|
||||
{
|
||||
mText[i] = ':';
|
||||
}
|
||||
}
|
||||
|
||||
theCommand += mText;
|
||||
theCommand += mText;
|
||||
|
||||
theCommand += "\"";
|
||||
theCommand += "\"";
|
||||
|
||||
//say_x "the message here" instead of
|
||||
//say_x the message here (ever word was treated as another argument)
|
||||
gEngfuncs.pfnClientCmd((char*)theCommand.c_str());
|
||||
//say_x "the message here" instead of
|
||||
//say_x the message here (ever word was treated as another argument)
|
||||
gEngfuncs.pfnClientCmd((char*)theCommand.c_str());
|
||||
|
||||
CancelChat();
|
||||
CancelChat();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue