mirror of
https://github.com/smartcmd/MinecraftConsoles.git
synced 2026-07-23 19:17:06 +00:00
Failsafe for signs if entered over max line length
This commit is contained in:
parent
8ecfc52547
commit
ec9aad2caa
|
|
@ -167,8 +167,12 @@ void SignTileEntity::setChanged()
|
||||||
|
|
||||||
void SignTileEntity::SetMessage(int iIndex,wstring &wsText)
|
void SignTileEntity::SetMessage(int iIndex,wstring &wsText)
|
||||||
{
|
{
|
||||||
|
if (wsText.length() > MAX_LINE_LENGTH) // MAX_LINE_LENGTH == 15
|
||||||
|
{
|
||||||
|
wsText = wsText.substr(0, MAX_LINE_LENGTH);
|
||||||
|
OutputDebugStringW(L"Sign text truncated to 15 characters\n");
|
||||||
|
}
|
||||||
m_wsmessages[iIndex]=wsText;
|
m_wsmessages[iIndex]=wsText;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 4J-PB - added for string verification
|
// 4J-PB - added for string verification
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue