aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.World
diff options
context:
space:
mode:
Diffstat (limited to 'Minecraft.World')
-rw-r--r--Minecraft.World/SignTileEntity.cpp10
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