From 3fc1bdecb31cbf2b813c23589fc7b6be644ea0db Mon Sep 17 00:00:00 2001 From: David Cernat Date: Thu, 31 Aug 2017 18:41:37 +0300 Subject: [PATCH] [Client] Shorten player names to 31 characters after they are inputted --- apps/openmw/mwgui/charactercreation.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/apps/openmw/mwgui/charactercreation.cpp b/apps/openmw/mwgui/charactercreation.cpp index 2deb62215..45acdc595 100644 --- a/apps/openmw/mwgui/charactercreation.cpp +++ b/apps/openmw/mwgui/charactercreation.cpp @@ -397,6 +397,18 @@ namespace MWGui if (mNameDialog) { mPlayerName = mNameDialog->getTextInput(); + + /* + Start of tes3mp change (major) + + Ensure names are not longer than the original game's 31 character maximum + */ + if (mPlayerName.length() > 31) + mPlayerName = mPlayerName.substr(0, 31); + /* + End of tes3mp change (major) + */ + MWBase::Environment::get().getWindowManager()->setValue("name", mPlayerName); MWBase::Environment::get().getMechanicsManager()->setPlayerName(mPlayerName); MWBase::Environment::get().getWindowManager()->removeDialog(mNameDialog);