Core\Characters: Consecutive letters validation for CheckPlayerName

Closes #7694
This commit is contained in:
Kiddie
2012-09-08 17:29:27 +01:00
committed by Nay
parent b03b112327
commit 9a962f86c9

View File

@@ -7301,6 +7301,11 @@ uint8 ObjectMgr::CheckPlayerName(const std::string& name, bool create)
if (!isValidString(wname, strictMask, false, create))
return CHAR_NAME_MIXED_LANGUAGES;
wstrToLower(wname);
for (size_t i = 2; i < wname.size(); ++i)
if (wname[i] == wname[i-1] && wname[i] == wname[i-2])
return CHAR_NAME_THREE_CONSECUTIVE;
return CHAR_NAME_SUCCESS;
}