mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/LCE-Revelations.git
synced 2026-09-24 15:20:46 +00:00
Failsafe for signs if entered over max line length (#389)
* Failsafe for signs if entered over max line length * Removed debug message. * Revert "Removed debug message." This reverts commit 553c43669769dc0468c266f1e31778552c615d0c. * Update SignTileEntity.cpp * Changed flag to _DEBUG
This commit is contained in:
@@ -167,8 +167,14 @@ 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);
|
||||||
|
#ifdef _DEBUG
|
||||||
|
OutputDebugStringW(L"Sign text truncated to 15 characters\n");
|
||||||
|
#endif
|
||||||
|
}
|
||||||
m_wsmessages[iIndex]=wsText;
|
m_wsmessages[iIndex]=wsText;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 4J-PB - added for string verification
|
// 4J-PB - added for string verification
|
||||||
|
|||||||
Reference in New Issue
Block a user