mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
Clean up other paste code a bit
This commit is contained in:
parent
b7d4beccea
commit
b0b2774695
|
@ -127,18 +127,14 @@ bool CChat::OnInput(IInput::CEvent Event)
|
|||
{
|
||||
if(Text[i] == '\n')
|
||||
{
|
||||
int max = i - Begin + 1;
|
||||
if(max > (int)sizeof(Line))
|
||||
max = sizeof(Line);
|
||||
int max = min(i - Begin + 1, (int)sizeof(Line));
|
||||
str_copy(Line, Text + Begin, max);
|
||||
Begin = i+1;
|
||||
SayChat(Line);
|
||||
while(Text[i] == '\n') i++;
|
||||
}
|
||||
}
|
||||
int max = i - Begin + 1;
|
||||
if(max > (int)sizeof(Line))
|
||||
max = sizeof(Line);
|
||||
int max = min(i - Begin + 1, (int)sizeof(Line));
|
||||
str_copy(Line, Text + Begin, max);
|
||||
Begin = i+1;
|
||||
m_Input.Add(Line);
|
||||
|
|
|
@ -108,17 +108,13 @@ void CGameConsole::CInstance::OnInput(IInput::CEvent Event)
|
|||
Begin++;
|
||||
continue;
|
||||
}
|
||||
int max = i - Begin + 1;
|
||||
if(max > (int)sizeof(Line))
|
||||
max = sizeof(Line);
|
||||
int max = min(i - Begin + 1, (int)sizeof(Line));
|
||||
str_copy(Line, Text + Begin, max);
|
||||
Begin = i+1;
|
||||
ExecuteLine(Line);
|
||||
}
|
||||
}
|
||||
int max = i - Begin + 1;
|
||||
if(max > (int)sizeof(Line))
|
||||
max = sizeof(Line);
|
||||
int max = min(i - Begin + 1, (int)sizeof(Line));
|
||||
str_copy(Line, Text + Begin, max);
|
||||
Begin = i+1;
|
||||
m_Input.Add(Line);
|
||||
|
|
Loading…
Reference in a new issue