From 07f46f3f7b19ac35dd00e94f9f46f03368a172ac Mon Sep 17 00:00:00 2001 From: titiger Date: Mon, 9 Nov 2015 01:48:26 +0100 Subject: [PATCH] bugfix for ctrl-v --- source/glest_game/game/chat_manager.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/source/glest_game/game/chat_manager.cpp b/source/glest_game/game/chat_manager.cpp index d6fb38df..a6b61af1 100644 --- a/source/glest_game/game/chat_manager.cpp +++ b/source/glest_game/game/chat_manager.cpp @@ -101,10 +101,11 @@ bool ChatManager::textInput(std::string inputText) { int maxTextLenAllowed = (customCB != NULL ? this->maxCustomTextLength : maxTextLenght); int maxpaste=0; maxpaste=maxTextLenAllowed-text.length(); + string textToAdd=inputText.substr (0,maxpaste); if(editEnabled && (int)text.length() < maxTextLenAllowed) { SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__); - textCharLength.push_back(inputText.length()); - this->text +=inputText.substr (0,maxpaste); + textCharLength.push_back(textToAdd.length()); + this->text +=textToAdd; updateAutoCompleteBuffer(); return true; }