diff options
| author | disintegrate <oleajascha@gmail.com> | 2026-03-05 15:30:56 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-03-05 14:30:56 +0700 |
| commit | 33c798a885476d07394a20908390a5b4d6207a10 (patch) | |
| tree | 4fa9a7e991dc0c71cbcc20edab8b4be6187471bb /Minecraft.World | |
| parent | fcc9970ec6148bf63a88f4fb1bf7f4abb4b107a2 (diff) | |
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
Diffstat (limited to 'Minecraft.World')
| -rw-r--r-- | Minecraft.World/SignTileEntity.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/Minecraft.World/SignTileEntity.cpp b/Minecraft.World/SignTileEntity.cpp index 74adc8cc..dc189102 100644 --- a/Minecraft.World/SignTileEntity.cpp +++ b/Minecraft.World/SignTileEntity.cpp @@ -166,9 +166,15 @@ void SignTileEntity::setChanged() 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; - } // 4J-PB - added for string verification |
