tiny style changes

This commit is contained in:
Ryozuki 2017-02-18 09:02:29 +01:00
parent 141a256cb3
commit 9af59fe8f3

View file

@ -166,11 +166,11 @@ bool CChat::OnInput(IInput::CEvent Event)
int FoundAt = SearchDirection > 0 ? m_Input.GetLength() - 1 : 0; int FoundAt = SearchDirection > 0 ? m_Input.GetLength() - 1 : 0;
for(int i = m_Input.GetCursorOffset() + SearchDirection; SearchDirection > 0 ? i < m_Input.GetLength() - 1 : i > 0; i += SearchDirection) for(int i = m_Input.GetCursorOffset() + SearchDirection; SearchDirection > 0 ? i < m_Input.GetLength() - 1 : i > 0; i += SearchDirection)
{ {
int next = i + SearchDirection; int Next = i + SearchDirection;
if( (m_Input.GetString()[next] == ' ') || if( (m_Input.GetString()[Next] == ' ') ||
(m_Input.GetString()[next] >= 32 && m_Input.GetString()[next] <= 47) || (m_Input.GetString()[Next] >= 32 && m_Input.GetString()[Next] <= 47) ||
(m_Input.GetString()[next] >= 58 && m_Input.GetString()[next] <= 64) || (m_Input.GetString()[Next] >= 58 && m_Input.GetString()[Next] <= 64) ||
(m_Input.GetString()[next] >= 91 && m_Input.GetString()[next] <= 96)) (m_Input.GetString()[Next] >= 91 && m_Input.GetString()[Next] <= 96))
{ {
FoundAt = i; FoundAt = i;
if (SearchDirection < 0) if (SearchDirection < 0)
@ -182,13 +182,13 @@ bool CChat::OnInput(IInput::CEvent Event)
{ {
if(m_Input.GetCursorOffset() != 0) if(m_Input.GetCursorOffset() != 0)
{ {
char Text[512]; char aText[512];
str_copy(Text, m_Input.GetString(), FoundAt + 1); str_copy(aText, m_Input.GetString(), FoundAt + 1);
if(m_Input.GetCursorOffset() != str_length(m_Input.GetString())) if(m_Input.GetCursorOffset() != str_length(m_Input.GetString()))
str_append(Text, m_Input.GetString() + m_Input.GetCursorOffset(), str_length(m_Input.GetString())); str_append(aText, m_Input.GetString() + m_Input.GetCursorOffset(), str_length(m_Input.GetString()));
m_Input.Set(Text); m_Input.Set(aText);
} }
} }
m_Input.SetCursorOffset(FoundAt); m_Input.SetCursorOffset(FoundAt);